Files
CHOMPStation2/.github/workflows/run_integration_tests.yml
dependabot[bot] 7987fca6ee Bump actions/checkout from 4 to 5 (#11402)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 22:21:19 +02:00

83 lines
2.8 KiB
YAML

name: Run Integration Tests
on:
workflow_call:
inputs:
map:
required: true
type: string
major:
required: false
type: string
minor:
required: false
type: string
max_required_byond_client:
required: true
type: string
jobs:
run_integration_tests:
# If `inputs.major` is specified, this will output `Run Tests (major.minor; map; max)`.
# For example, `Run Tests (515.1627; runtimestation; 515)`.
#
# Otherwise, it will output `Run Tests (map; max)`.
# For example, `Run Tests (runtimestation; 515)`.
name: Run Tests (${{ inputs.major && format('{0}.{1}; ', inputs.major, inputs.minor) || '' }}${{ inputs.map }}; ${{ inputs.max_required_byond_client }})
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- name: Ensure +x on CI directory
run: |
chmod -R +x ./tools/ci
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
major: ${{ inputs.major }}
minor: ${{ inputs.minor }}
- name: Install RUST_G Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install zlib1g-dev:i386
ldd librust_g.so
ldd libbapi_dmm_reader.so
ldd libverdigris.so
- name: Unit Tests
id: run_tests
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DUNIT_TESTS -D${{ inputs.map }}"
RUN: "1"
- name: On test fail, write a step summary
if: always() && steps.run_tests.outcome == 'failure'
run: |
# Get a JSON array of failed unit tests
FAILED_UNIT_TESTS=$(jq 'to_entries | map(.value | select(.status == 1))' data/unit_tests.json)
FAIL_COUNT=$(echo $FAILED_UNIT_TESTS | jq 'length')
echo "# Test failures" >> $GITHUB_STEP_SUMMARY
echo "$FAIL_COUNT tests failed." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for i in $( seq $FAIL_COUNT ); do
CURRENT_FAIL=$(echo $FAILED_UNIT_TESTS | jq --arg i $i '.[($i | tonumber) - 1]')
TEST=$(echo $CURRENT_FAIL | jq --raw-output '.name')
echo "### $TEST" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo $CURRENT_FAIL | jq --raw-output '.message' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
done
- name: Check client Compatibility
if: always() && steps.compile_tests.outcome == 'success'
uses: tgstation/byond-client-compatibility-check@v3
with:
dmb-location: vorestation.dmb
max-required-client-version: ${{inputs.max_required_byond_client}}