mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 17:14:47 +01:00
6e9f2ccfc0
# Conflicts: # .github/workflows/compile_all_maps.yml # .github/workflows/run_integration_tests.yml # _maps/map_files/CatwalkStation/CatwalkStation_2023.dmm # code/_onclick/hud/credits.dm # code/controllers/subsystem/networks/id_access.dm # code/datums/diseases/advance/advance.dm # code/datums/diseases/advance/symptoms/heal.dm # code/game/machinery/doors/door.dm # code/game/objects/structures/crates_lockers/closets/secure/medical.dm # code/game/objects/structures/crates_lockers/closets/secure/security.dm # code/modules/antagonists/malf_ai/malf_ai_modules.dm # code/modules/jobs/job_types/_job.dm # code/modules/loadout/categories/accessories.dm # code/modules/loadout/loadout_helpers.dm # code/modules/loadout/loadout_items.dm # code/modules/loadout/loadout_preference.dm # code/modules/mob/living/silicon/robot/robot_defense.dm # code/modules/mod/mod_theme.dm # code/modules/projectiles/ammunition/energy/laser.dm # code/modules/reagents/reagent_containers/cups/drinks.dm # code/modules/shuttle/mobile_port/variants/supply.dm # code/modules/surgery/organs/internal/eyes/_eyes.dm # code/modules/unit_tests/screenshots/screenshot_antag_icons_heretic.png # icons/hud/screen_full.dmi
100 lines
3.9 KiB
YAML
100 lines
3.9 KiB
YAML
# This is a reusable workflow to run integration tests on a single map.
|
|
# This is run for every single map in ci_suite.yml. You might want to edit that instead.
|
|
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: 25
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Restore BYOND from Cache
|
|
uses: ./.github/actions/restore_or_install_byond
|
|
with:
|
|
major: ${{ inputs.major }}
|
|
minor: ${{ inputs.minor }}
|
|
- name: Download build outputs
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: build-artifact-${{ inputs.major || env.BYOND_MAJOR }}-${{ inputs.minor || env.BYOND_MINOR}}
|
|
path: ./
|
|
- name: Setup database
|
|
env:
|
|
MYSQL_CONFIG_FILE: tools/ci/mysql_config.cnf
|
|
run: |
|
|
sudo systemctl start mysql
|
|
mysql --defaults-extra-file=${{ env.MYSQL_CONFIG_FILE }} -e 'CREATE DATABASE tg_ci;'
|
|
mysql --defaults-extra-file=${{ env.MYSQL_CONFIG_FILE }} tg_ci < SQL/tgstation_schema.sql
|
|
mysql --defaults-extra-file=${{ env.MYSQL_CONFIG_FILE }} -e 'CREATE DATABASE tg_ci_prefixed;'
|
|
mysql --defaults-extra-file=${{ env.MYSQL_CONFIG_FILE }} tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
|
|
echo "Sucessful MySQL Database Setup"
|
|
- name: Install rust-g
|
|
run: |
|
|
bash tools/ci/install_rust_g.sh
|
|
- name: Install dreamluau
|
|
run: |
|
|
bash tools/ci/install_dreamluau.sh
|
|
- name: Run Tests
|
|
id: run_tests
|
|
run: |
|
|
source $HOME/BYOND/byond/bin/byondsetup
|
|
bash tools/ci/run_server.sh ${{ inputs.map }}
|
|
- name: Upload screenshot tests
|
|
if: always()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: test_artifacts_${{ inputs.map }}_${{ inputs.major }}_${{ inputs.minor }}
|
|
path: data/screenshots_new/
|
|
retention-days: 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: tgstation.dmb
|
|
max-required-client-version: ${{inputs.max_required_byond_client}}
|