Unit Test rework & Master/Ticker update (#17912)

* Unit Test rework & Master/Ticker update

* Fixes and working unit testing

* Fixes

* Test fixes and FA update

* Fixed runtimes

* Radio subsystem

* move that glob wherever later

* ident

* CIBUILDING compile option

* Fixed runtimes

* Some changes to the workflow

* CI Split

* More split

* Pathing

* Linters and Annotators

* ci dir fix

* Missing undef fixed

* Enable grep checks

* More test conversions

* More split

* Correct file

* Removes unneeded inputs

* oop

* More dependency changes

* More conversions

* Conversion fixes

* Fixes

* Some assert fixes

* Corrects start gate

* Converted some README.dms to README.mds

* Removes duplicate proc

* Removes unused defines

* Example configs

* fix dll access viol by double calling

* Post-rebase fixes

* Cleans up names global list

* Undef restart counter

* More code/game/ cleanup

* Statpanel update

* Skybox

* add

* Fix ticker

* Roundend fix

* Persistence dependency update

* Reordering

* Reordering

* Reordering

* Initstage fix

* .

* .

* Reorder

* Reorder

* Circle

* Mobs

* Air

* Test fix

* CI Script Fix

* Configs

* More ticker stuff

* This is now in 'reboot world'

* Restart world announcements

* no glob in PreInit

* to define

* Update

* Removed old include

* Make this file normal again

* moved

* test

* shared unit testing objects

* Updates batched_spritesheets and universal_icon

* .

* job data debug

* rm that

* init order

* show us

* .

* i wonder

* .

* .

* urg

* do we not have a job ID?

* .

* rm sleep for now

* updated rust-g linux binaries

* binaries update 2

* binaries update 3

* testing something

* change that

* test something

* .

* .

* .

* locavar

* test

* move that

* .

* debug

* don't run this test

* strack trace it

* cleaner

* .

* .

* cras again

* also comment this out

* return to official rust g

* Update robot_icons.dm

* monitor the generation

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-08-10 01:37:23 +02:00
committed by GitHub
parent 5e54e17ebd
commit f4bf017921
382 changed files with 10193 additions and 4421 deletions
+42 -163
View File
@@ -1,178 +1,57 @@
name: CI
name: CI Suite
on:
pull_request:
branches:
- master
- "project/**"
merge_group:
branches:
- master
env:
BASENAME: "vorestation"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
start_gate:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Start Gate
runs-on: ubuntu-24.04
steps:
- name: Mandatory Empty Step
run: exit 0
run_linters:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Run Linters
runs-on: ubuntu-24.04
concurrency:
group: run_linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Caches
- name: Setup Bun
uses: ./.github/actions/setup_bun
- name: Restore Bootstrap cache
uses: actions/cache@v4
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('tools/requirements.txt') }}
restore-keys: |
${{ runner.os }}-bootstrap-
- name: Restore Rust cache
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('tools/ci/ci_dependencies.sh')}}
restore-keys: |
${{ runner.os }}-rust-
- name: Restore Cutter cache
uses: actions/cache@v4
with:
path: tools/icon_cutter/cache
key: ${{ runner.os }}-cutter-${{ hashFiles('dependencies.sh') }}
# End Caches
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_ripgrep.sh
bash tools/ci/install_spaceman_dmm.sh dmm-tools
tools/bootstrap/python -c ''
- name: Run Validation Tests
run: bash tools/ci/validate_files.sh
- name: Run Define Sanity Checks
run: tools/bootstrap/python -m define_sanity.check
- name: Run DMI Tests
run: tools/bootstrap/python -m dmi.test
- name: Run Map Checks
run: |
tools/bootstrap/python -m tools.maplint.source
tools/bootstrap/python -m mapmerge2.dmm_test
- name: Run TGUI Checks
run: tools/build/build.sh --ci lint tgui-test
- name: Run Nanomap Checks
run: tools/github-actions/nanomap-renderer-invoker.sh --testing
needs: start_gate
uses: ./.github/workflows/run_linters.yml
dreamchecker:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: DreamChecker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Restore SpacemanDMM Cache
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
restore-keys: ${{ runner.os }}-dreamchecker
- name: Install Dependencies
run: |
tools/ci/install_spaceman_dmm.sh dreamchecker
- name: Run Linter
id: linter
run: |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Linter
uses: yogstation13/DreamAnnotate@v2
if: always()
with:
outputFile: output-annotations.txt
odlint:
name: Lint with OpenDream
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9
- uses: actions/checkout@v4
- uses: robinraju/release-downloader@v1.12
with:
repository: "OpenDreamProject/OpenDream"
tag: "latest"
fileName: "DMCompiler_linux-x64.tar.gz"
extract: true
- run: ./DMCompiler_linux-x64/DMCompiler --suppress-unimplemented vorestation.dme
unit_tests:
timeout-minutes: 30
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
strategy:
matrix:
map: ["USE_MAP_TETHER", "USE_MAP_STELLARDELIGHT", "USE_MAP_GROUNDBASE"]
# name: Integration Tests (${{ matrix.map }})
run_all_tests:
name: Integration Tests
# needs: ['run_linters', 'dreamchecker']
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- 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
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DUNIT_TEST -D${{ matrix.map }}"
RUN: "1"
needs: start_gate
uses: ./.github/workflows/perform_regular_version_tests.yml
with:
maps: '{"paths":["USE_MAP_TETHER","USE_MAP_STELLARDELIGHT","USE_MAP_GROUNDBASE"]}'
max_required_byond_client: 516
extra_map_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Map Tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- 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: Compile POIs
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DMAP_TEST"
RUN: "0"
- name: Compile away missions
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DAWAY_MISSION_TEST -DUSE_MAP_TETHER" # Only Tether has support for all away missions
RUN: "0"
run_extra_map_tests:
name: Extra Map Tests
needs: start_gate
uses: ./.github/workflows/run_extra_map_tests.yml
tests_successful:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Integration Tests
needs: ["run_linters", "dreamchecker", "unit_tests", "extra_map_tests"]
completion_gate: # Serves as a non-moving target for branch rulesets
if: always() && !cancelled()
name: Completion Gate
needs:
[
run_all_tests,
run_extra_map_tests,
run_linters,
]
runs-on: ubuntu-24.04
steps:
- name: Report Success
run: |
echo "Jobs Successful!"
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
@@ -0,0 +1,24 @@
name: Run Regular BYOND Version Tests
on:
workflow_call:
inputs:
maps:
required: true
type: string
max_required_byond_client:
required: true
type: string
jobs:
run:
uses: ./.github/workflows/run_integration_tests.yml
strategy:
fail-fast: false
matrix:
map: ${{ fromJSON(inputs.maps).paths }}
with:
map: ${{ matrix.map }}
max_required_byond_client: ${{ inputs.max_required_byond_client }}
+51
View File
@@ -0,0 +1,51 @@
name: Run Extra Map Tests
on:
workflow_call:
inputs:
major:
required: false
type: string
minor:
required: false
type: string
jobs:
run_extra_map_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 Extra Map Tests (${{ inputs.major && format('{0}.{1}; ', inputs.major, inputs.minor) || '' }})
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- 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: Compile POIs
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DMAP_TEST"
RUN: "0"
- name: Compile away missions
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DAWAY_MISSION_TEST -DUSE_MAP_TETHER" # Only Tether has support for all away missions
RUN: "0"
@@ -0,0 +1,82 @@
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: 15
steps:
- uses: actions/checkout@v4
- 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}}
+111
View File
@@ -0,0 +1,111 @@
name: Run Linters
on:
workflow_call:
jobs:
linters:
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Caches
- name: Restore SpacemanDMM cache
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-spacemandmm-
- name: Setup Bun
uses: ./.github/actions/setup_bun
- name: Restore Bootstrap cache
uses: actions/cache@v4
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('tools/requirements.txt') }}
restore-keys: |
${{ runner.os }}-bootstrap-
- name: Restore Rust cache
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('tools/ci/ci_dependencies.sh')}}
restore-keys: |
${{ runner.os }}-rust-
- name: Restore Cutter cache
uses: actions/cache@v4
with:
path: tools/icon_cutter/cache
key: ${{ runner.os }}-cutter-${{ hashFiles('dependencies.sh') }}
# End Caches
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 9.x
- name: Install OpenDream
uses: robinraju/release-downloader@v1.12
with:
repository: "OpenDreamProject/OpenDream"
tag: "latest"
fileName: "DMCompiler_linux-x64.tar.gz"
extract: true
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_spaceman_dmm.sh dreamchecker
bash tools/ci/install_ripgrep.sh
tools/bootstrap/python -c ''
- name: Give Linters A Go
id: linter-setup
run: ":"
- name: Ensure genesis_call.dme is unchanged
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_genesis.sh
- name: Run Grep Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_grep.sh
#- name: Ticked File Enforcement
# if: steps.linter-setup.conclusion == 'success' && !cancelled()
# run: |
# tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/tgstation_dme.json
# tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/unit_tests.json
- name: Run Define Sanity Checks
run: tools/bootstrap/python -m define_sanity.check
- name: Run DreamChecker
if: steps.linter-setup.conclusion == 'success' && !cancelled()
shell: bash
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
- name: Run OpenDream
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: ./DMCompiler_linux-x64/DMCompiler vorestation.dme --suppress-unimplemented --define=CIBUILDING | bash tools/ci/annotate_od.sh
- name: Run Map Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
tools/bootstrap/python -m mapmerge2.dmm_test
tools/bootstrap/python -m tools.maplint.source
- name: Check Cutter
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m tools.icon_cutter.check
- name: Run DMI Tests
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m dmi.test
#- name: Check File Directories
# if: steps.linter-setup.conclusion == 'success' && !cancelled()
# run: bash tools/ci/check_filedirs.sh tgstation.dme
- name: Check Changelogs
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_changelogs.sh
- name: Check Miscellaneous Files
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_misc.sh
- name: Run TGUI Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/build/build.sh --ci lint tgui-test
- name: Run Nanomap Checks
run: tools/github-actions/nanomap-renderer-invoker.sh --testing