mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2026-09-01 03:47:30 +02:00
Horizon qa (#68)
This commit is contained in:
@@ -31,6 +31,21 @@ on:
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
horizonqa:
|
||||
description: 'Run Horizon-QA in CI mode during runServer'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
horizonqa-tests:
|
||||
description: 'Optional -Dhorizonqa.tests selector'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
horizonqa-allow-no-tests:
|
||||
description: 'Allow Horizon-QA CI to pass with no discovered tests'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
@@ -52,7 +67,8 @@ jobs:
|
||||
- name: Checkout workflows repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: GTNewHorizons/GTNH-Actions-Workflows
|
||||
repository: ${{ job.workflow_repository }}
|
||||
ref: ${{ job.workflow_sha }}
|
||||
path: .gtnh-workflows
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -139,6 +155,12 @@ jobs:
|
||||
|
||||
- name: Run server for up to ${{ inputs.timeout }} seconds
|
||||
if: ${{ !inputs.client-only }}
|
||||
shell: bash
|
||||
env:
|
||||
HORIZONQA: ${{ inputs.horizonqa }}
|
||||
HORIZONQA_TESTS: ${{ inputs.horizonqa-tests }}
|
||||
HORIZONQA_ALLOW_NO_TESTS: ${{ inputs.horizonqa-allow-no-tests }}
|
||||
DISABLE_SERVER_AUTO_STOP: ${{ inputs.disable-server-auto-stop }}
|
||||
run: |
|
||||
mkdir -p run/server
|
||||
echo "eula=true" > run/eula.txt
|
||||
@@ -147,12 +169,57 @@ jobs:
|
||||
echo "level-seed=-6202107849386030209\nonline-mode=true\n" > run/server.properties
|
||||
echo "level-seed=-6202107849386030209\nonline-mode=true\n" > run/server/server.properties
|
||||
|
||||
gradle_args=(--build-cache --info --stacktrace runServer)
|
||||
|
||||
if [[ "${HORIZONQA}" == "true" ]]; then
|
||||
horizonqa_jvm_args=(
|
||||
"-Dhorizonqa.mode=ci"
|
||||
"-Dhorizonqa.reportDir=${GITHUB_WORKSPACE}/build/horizonqa"
|
||||
)
|
||||
|
||||
if [[ -n "${HORIZONQA_TESTS}" ]]; then
|
||||
horizonqa_jvm_args+=("-Dhorizonqa.tests=${HORIZONQA_TESTS}")
|
||||
fi
|
||||
|
||||
if [[ "${HORIZONQA_ALLOW_NO_TESTS}" == "true" ]]; then
|
||||
horizonqa_jvm_args+=("-Dhorizonqa.allowNoTests=true")
|
||||
fi
|
||||
|
||||
for jvm_arg in "${horizonqa_jvm_args[@]}"; do
|
||||
gradle_args+=(--mcJvmArgs="${jvm_arg}")
|
||||
done
|
||||
fi
|
||||
|
||||
server_stdin=/dev/null
|
||||
if [[ "${{ inputs.disable-server-auto-stop }}" != "true" ]]; then
|
||||
if [[ "${DISABLE_SERVER_AUTO_STOP}" != "true" && "${HORIZONQA}" != "true" ]]; then
|
||||
echo "stop" > run/stop.txt
|
||||
server_stdin=run/stop.txt
|
||||
fi
|
||||
timeout ${{ inputs.timeout }} ./gradlew --build-cache --info --stacktrace runServer 2>&1 < "${server_stdin}" | tee -a server.log || true
|
||||
timeout ${{ inputs.timeout }} ./gradlew "${gradle_args[@]}" 2>&1 < "${server_stdin}" | tee -a server.log || true
|
||||
|
||||
- name: Upload Horizon-QA reports
|
||||
if: ${{ always() && !inputs.client-only && inputs.horizonqa }}
|
||||
uses: actions/upload-artifact@v7
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: ${{ github.repository_id }}-horizonqa
|
||||
path: build/horizonqa/
|
||||
retention-days: 90
|
||||
|
||||
- name: Summarize Horizon-QA result
|
||||
if: ${{ always() && !inputs.client-only && inputs.horizonqa }}
|
||||
shell: bash
|
||||
continue-on-error: true
|
||||
run: |
|
||||
chmod +x .gtnh-workflows/scripts/summarize_horizonqa_result
|
||||
.gtnh-workflows/scripts/summarize_horizonqa_result
|
||||
|
||||
- name: Test Horizon-QA result
|
||||
if: ${{ always() && !inputs.client-only && inputs.horizonqa }}
|
||||
shell: bash
|
||||
run: |
|
||||
chmod +x .gtnh-workflows/scripts/test_horizonqa_result
|
||||
.gtnh-workflows/scripts/test_horizonqa_result
|
||||
|
||||
- name: Test no errors reported during server run
|
||||
if: ${{ !inputs.client-only }}
|
||||
|
||||
Reference in New Issue
Block a user