Skip to content

Commit

Permalink
The Testening: Ports improved unit tests from TG, New mapping tests, …
Browse files Browse the repository at this point in the history
…Refactors of existing tests to improve code quality (#11364)

* Fixes redefined defines

* Adds trait validity

* Adds ticked file enforcement

Co-Authored-By: san7890 <[email protected]>
Co-Authored-By: LemonInTheDark <[email protected]>

* Fixes references to TGstation isntead of Beestation

* Create max_required_byond_client.txt

Co-Authored-By: Kyle Spier-Swenson <[email protected]>
Co-Authored-By: Mothblocks <[email protected]>

* Fixes qdel in optimisation

* I don't think we need mariaDB anymore

* Update run_server.sh

* Updates check_grep to include the new

* Adds mapping tests

* Adds some mapping testers

* Disables create and destroy

* Update run_server.sh

Co-Authored-By: Mothblocks <[email protected]>
Co-Authored-By: Jordan Dominion <[email protected]>
Co-Authored-By: LemonInTheDark <[email protected]>
Co-Authored-By: Tastyfish <[email protected]>

* Fixes compilation

* Fixes compilation issues

* Corrects the DME target

* Removes auxmos temporarilly

* Revert "Removes auxmos temporarilly"

This reverts commit 4c42c82.

* Disables restore_atmos

* Re-enables atmos reset

* Fixes crashing issues

* Fixes issue with disposal unit test check

* Another correction in disposal tests

* Fixes infinite loop check

* Correctly return when we encounter an error

* Fixes failures not being properly

* Fixes disposal loop bug

* Account for the complete shitcode of disposals

* Update check_disposals.dm

* Fixes

* Debug info

* Update check_disposals.dm

* Fixes the stupidity of sort codes

* Corrects a mistake

* Makes run ID properly unique

* Update check_disposals.dm

* Update check_disposals.dm

* Fixes some areas interacting wtih APC checks

* Random rooms will delete any directional things not placed on walls, fixes inconsistent indentation

* Adds a somewhat hacky check to fix random maint room spawning

* Update check_disposals.dm

* Fixes ending in a null location

* Fixes disposals detecting loops when there are none

* Adds more information to the failure

* Fixes an issue with the disposals check

* Update check_disposals.dm

* Update check_disposals.dm

* /area/medical/apothecary is valid for the output of chemistry

* Fixes the issue with virology and finally resolves issues with the disposals checker

* Adds a check for multiple objects on the same turf

* Fixes the multiple object check

* Update check_multiple_objects.dm

* Update check_multiple_objects.dm

* Update check_multiple_objects.dm

* Fixes list messages

* Assume that things with different pixel offsets are intended to be different

* Corrects some issues with the map tests

* How about we just disable random maints on unit testing

* Update check_wallthing_attachment.dm

* warnings fix

* Allows disposals to end in delivery office

* Squashed commit of the following:

commit 18bbae7
Author: PowerfulBacon <[email protected]>
Date:   Fri Aug 30 19:49:01 2024 +0100

    Allows disposals to end in delivery office

commit 565af66
Author: PowerfulBacon <[email protected]>
Date:   Fri Aug 30 19:09:53 2024 +0100

    Merges 2 files together

commit 195fa7c
Author: PowerfulBacon <[email protected]>
Date:   Fri Aug 30 18:58:57 2024 +0100

    Adds in mapping helpers for disposals

commit 611dd96
Author: ss13-beebot <[email protected]>
Date:   Fri Aug 30 00:12:46 2024 +0000

    Automatic changelog compile [ci skip]

commit 522552a
Author: ss13-beebot <[email protected]>
Date:   Thu Aug 29 18:03:54 2024 +0000

    Automatic changelog compile [ci skip]

commit 1f5a444
Author: ss13-beebot <[email protected]>
Date:   Thu Aug 29 12:28:03 2024 -0500

    Automatic changelog generation for PR #11366 [ci skip]

commit c05a8ee
Author: Rukofamicom <[email protected]>
Date:   Thu Aug 29 12:18:22 2024 -0500

    Gibtonite flashes again (#11366)

commit af85a21
Author: ss13-beebot <[email protected]>
Date:   Thu Aug 29 17:03:19 2024 +0000

    Automatic changelog compile [ci skip]

commit 000ed5c
Author: ss13-beebot <[email protected]>
Date:   Thu Aug 29 11:23:27 2024 -0500

    Automatic changelog generation for PR #10983 [ci skip]

commit fd1e700
Author: Dejaku51 <[email protected]>
Date:   Thu Aug 29 18:13:47 2024 +0200

    Server framework v2 (#10983)

    * i don't remember what is happening

    * much better

    * just debug stuff

    * the ideas are coming

    * that shouldn't be here

    * it works now!

    * RnD servers integrated

    * sparks!

    * no more "if true return true"

    * reverse logic

    * adds ! to comments in stat.dm

    * clean up after yourself on Destroy()

    * splits early return

    * clean up after yourself tcomm monitoring

    * you too all tcomms machines

    * adds type holder instead of GetComponents

    * fix indentation

    * cmon indentation

    * HOW?!

    * oopsie woopsie

    * removes TODO and adds a comment

    * packet types and null on destroy

    * update comment

    * fixed radstation tcomms area + switches hub with blackbox

    * rebalances tcomms heat generation

    * fix echo tcomms cooling

    * that should stop funny exploit discovered by aramix

    * cooldown define

    * remove useless signal

    * opened machine is under maintenance

    * return null instead of 0 points

    * return false

    * I HATE TESTS

commit 79ee753
Author: ss13-beebot <[email protected]>
Date:   Thu Aug 29 00:12:28 2024 +0000

    Automatic changelog compile [ci skip]

commit f4028a7
Author: ss13-beebot <[email protected]>
Date:   Wed Aug 28 16:03:51 2024 +0000

    Automatic changelog compile [ci skip]

commit ded9e05
Author: ss13-beebot <[email protected]>
Date:   Wed Aug 28 10:18:28 2024 -0500

    Automatic changelog generation for PR #11373 [ci skip]

commit c95ed70
Author: ClownMoff <[email protected]>
Date:   Wed Aug 28 15:59:25 2024 +0100

    Update cigarette.dm (#11373)

commit a251e91
Author: ss13-beebot <[email protected]>
Date:   Wed Aug 28 10:08:53 2024 -0500

    Automatic changelog generation for PR #11387 [ci skip]

commit 61b21cc
Author: XeonMations <[email protected]>
Date:   Wed Aug 28 17:58:39 2024 +0300

    Fixes simplemobs being able to interact with machinery (#11387)

    * another PR, another banger

    * comment moment

commit 1cf4941
Author: Markus Larsson <[email protected]>
Date:   Tue Aug 27 13:17:12 2024 +0200

    Delta Science Doors Fix (#11303)

    * Silly goose didn't use the "txt" var.

    * Update DeltaStation2.dmm

    * Update DeltaStation2.dmm

    * Update DeltaStation2.dmm

commit ceee177
Author: PowerfulBacon <[email protected]>
Date:   Tue Aug 27 11:35:01 2024 +0100

    Boxstation mapping fixes #11364 (#11368)

    * Fixes 89,129

    * Update BoxStation.dmm

    * Update BoxStation.dmm

    * Camera fixes

    * Adds in an unsorted loop to the boxstation package loop

    * Fixes direction of the sorting pipe

    * Fixes boxstation disposal issues

    * Fixes cameras

    * Fixes multiple objects stacked on top of each other

    * Fixes some lights placed on windows

    * Fixes all boxstation light issues

    * Update BoxStation.dmm

    * Fixes some lights placed on windows

    * Fixes all boxstation light issues

commit 8d8f3f8
Author: ss13-beebot <[email protected]>
Date:   Tue Aug 27 00:12:25 2024 +0000

    Automatic changelog compile [ci skip]

commit ff2162b
Author: ss13-beebot <[email protected]>
Date:   Mon Aug 26 18:11:15 2024 -0500

    Automatic changelog generation for PR #11385 [ci skip]

commit d1c6236
Author: XeonMations <[email protected]>
Date:   Tue Aug 27 02:01:44 2024 +0300

    Fuck ups of the year. (#11385)

* Properly disables random maint rooms if unit tests are not defined

* Removes wallthing attachment, we will tackle this in the future

* Update beestation.dme

* Update _unit_tests.dm

* Update check_grep.sh

* Ports define sanity

Co-Authored-By: san7890 <[email protected]>
Co-Authored-By: Mothblocks <[email protected]>
Co-Authored-By: Zephyr <[email protected]>

* [TEST]: Fixes room spawner clearing outside of its bounds

* Fixes APC checks

* Allow CI building to have 515 for OD compilation

* Removes some unused files

* Fixes metastation's invalid bag

* Fixes Nanotrasen misspellings

* Pipes are now hashed by their pipe layer

* Compilation fix

* Not all areas require power

* Resets changelog

* Screenshot tests only if they actually exist

* Update run_server.sh

* Attempt to fix OD lints

* Fixes some space indentation issues

* Creation test ignore turf_decal

* Test including create and destroy tests

* This will be far too much work to fix right now

* Fixes beestation.dme file ordering

* Fixes some missing undefs

* Allow _DEFINES to be declared anywhere, allow components to declare their own defines for modularisation purposes

* Fixes define sanity linter

* Fixes 03- src as trait source

* Adds in the LOWER_TEXT define

* Fixes the remaining tab/space indentation issues, and allows 2 spaces followed by a star

* Fixes the comment things

* Ports maplint

Co-Authored-By: Mothblocks <[email protected]>
Co-Authored-By: Tastyfish <[email protected]>
Co-Authored-By: san7890 <[email protected]>
Co-Authored-By: Zephyr <[email protected]>
Co-Authored-By: LemonInTheDark <[email protected]>
Co-Authored-By: Andrew <[email protected]>
Co-Authored-By: tattle <[email protected]>
Co-Authored-By: Jolly <[email protected]>
Co-Authored-By: die_amond <[email protected]>
Co-Authored-By: Tim <[email protected]>

* Removes this test as we currently do docking ports manually

* Updates the defines for the component module

* we need to scan subdirectories of unit tests now

* Fixes mixed indentation issues

* Fixes inconsistent human

* Ensures proper lowertext usage

* Corrects NanoTrasen to Nanotrasen

* Fixes recieved spelling mistakes

* Fixes update path files, allows tg_ before the name

* Fixes to_chat issues

* Corrects IMER_OVERRIDE used without TIMER_UNIQUE

* Fixes trailing newlines

* Fixes improper Initialize() arguments

* Allow for recursive directory travel

* Fixes some common spelling mistakes

* Fixes shuttles with objects outside of their shuttle boundaries

* Fixes ticked file enforcement

* Corrects a ticked file that shouldn't have been

* Organises the trait defines

* Fixes consistent human compilation and test compilation

* Fixes 2 final grep issues

* Update unit_tests.json

* Update declarations.dm

* Adds the traits file to global vars

* Update armour_checks.dm

* Fordbid the inclusion of anything in the unit tests subdirectories

* Should fix OD's unhapiness

* I guess that didn't allow the base directory...

* Corrects OD lint issues

* Corrects ticked_file_enforcement to always work no matter the circumstances

* Adds the ability to disable certain maplints

* Replace / with \\ inside dme files

* Very confusied right now

* Skip the warning when we are building CI

* Removes the layer var from being used in maps

* Adds begin and end include to _unit_tests.dm

* Fixes a few mapping lint issues

* Fixes missing unit tests

* Update _component.dm

* Compilation fix

* Fixes ticked file enforcement

* Update ticked_file_enforcement.py

* Update _unit_tests.dm

* Fixes the ordering

* Update _unit_tests.dm

* Update _unit_tests.dm

* We don't have nearly as many traits as TG does

* We don't need check changelogs

* Updates the build script and adds icon generation tools

Co-Authored-By: LemonInTheDark <[email protected]>
Co-Authored-By: oranges <[email protected]>

* Supports 514-515 dual compilation with JukeBuild

* Update _unit_tests.dm

* Fixes the missing trait declarations

* Update _traits.dm

* Update _traits.dm

* Update _traits.dm

* Update _traits.dm

* Switches back to using the spacestation13 repo

* Door Names

* mapping changes

* We don't use smart cables

* Update undergroundoutpost45.dmm

* Changes the formatting of the error to make it easier to search over

* Echostation merge conflict markers

* Obsolete var removal

* Update undergroundoutpost45.dmm

* Departments.dmm issues

* Update CentCom.dmm

* Do not edit areas

* Box, Fland, Meta

* Makes fridges opaque

* DeltaStation

* CorgStation

* RadStation, KiloStation

* Various maps

* Removes banned /area var-edits from Echo, Kilo and Rad

* Fixes fridges inside walls on EchoStation

* Adds a mapping helper for the air mix

* Fixes update paths

* Uncorrupts map files

* UpdatePaths

* Banned Var Edits

* EchoStation banned var-edits

* Echostation piping layer

* Echostation piping disaster fixes

* KiloStation Lints

* End of the nightmare lints

* Lints 2

* Adds the missing type

* Kilo, Meta, Rad, Fixes Pipe Check

* Update check_multiple_objects.dm

* Radstation

* Metastation lighting issues

* RadStation disposals

* KiloStation

* Route all disposals through security on RadStation

* Radstation mapfix v145

* Update RadStation.dmm

* Yea, we're a sorting network

* Always allow leading to an input node, because it just makes everyone's lives easier

* BoxStation fuck ups

* Fuck off

* Update check_disposals.dm

* Echo mapping fixes -disposals

* Update network.dm

* Update network.dm

* Update networks.dm

* Fixes RadStation disposals

* Corgstation final fixes

* CorgStation finishing touches

* Update KiloStation.dmm

* For some reason it was reaching a node

* Accept disposals going to janitor closet for kilo

* Flaky test shit

* Adds the show screenshot test results file

* FlandStation Part 1

* Fland disposal fixes

* Update FlandStation.dmm

* Fixes

* Update MetaStation.dmm

* MetaStation disposals

* Fixes metastation area mapping

* Update MetaStation.dmm

* Fixes incomplete disposal track on MetaStation

* Cleans up some disposals shitcode that mixed movement with direction grabbing

* Fixes multiz debug APCs

* Fixes an issue area on echo where it had no area

* Echostation disposals fixes

* Fixes dorms bypassing disposals filtering

* Echo disposals final touches

* Update EchoStation.dmm

* Allow this

* Update EchoStation.dmm

* Update EchoStation.dmm

* Update EchoStation.dmm

* Send a message when you start a unit test run

* Log it to world actually

* Update unit_test.dm

* Should fix an issue with unit tests never running

* Adds screenshot tests

Co-Authored-By: Mothblocks <[email protected]>

* Fixes a few issues

* Ports #86500

Co-Authored-By: oranges <[email protected]>

* Fixes mapping helpers not being deleted

* Removes the random boxstation door

* Apply suggestions from code review

Co-authored-by: Crossedfall <[email protected]>

* Fixes a tab indentation, fixes a file with the wrong indentation

* Bee: Disables the autowiki target

* Blanket removes heat capacity from usage in all maps

* Removes from random z levels

* Make sure we have parents too

* Fixes a race condition in shuttle loading

* Update shuttle.dm

* Removes some unnecessary greps

There are 3 greps that maplint is not currently expressive enough to handle

* Update pixel_varedits.yml

* I guess this works

---------

Co-authored-by: san7890 <[email protected]>
Co-authored-by: LemonInTheDark <[email protected]>
Co-authored-by: Kyle Spier-Swenson <[email protected]>
Co-authored-by: Mothblocks <[email protected]>
Co-authored-by: Jordan Dominion <[email protected]>
Co-authored-by: Tastyfish <[email protected]>
Co-authored-by: Zephyr <[email protected]>
Co-authored-by: Andrew <[email protected]>
Co-authored-by: tattle <[email protected]>
Co-authored-by: Jolly <[email protected]>
Co-authored-by: die_amond <[email protected]>
Co-authored-by: Tim <[email protected]>
Co-authored-by: oranges <[email protected]>
Co-authored-by: BriggsIDP <[email protected]>
Co-authored-by: Crossedfall <[email protected]>
  • Loading branch information
16 people authored Sep 8, 2024
1 parent 32cdd7a commit 7640e0c
Show file tree
Hide file tree
Showing 1,088 changed files with 27,828 additions and 29,898 deletions.
8 changes: 8 additions & 0 deletions .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file contains extra tests to run for specific BYOND versions.
# This is useful for making sure we maintain compatibility with both older and newer versions,
# while still having our main tests run on a guaranteed pinned version.

# Format is version: map
# Example:
# 500.1337: runtimestation
# 515.1627: runtimestation
8 changes: 8 additions & 0 deletions .github/max_required_byond_client.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Highest byond client version allowed to be required by the byond world. Set to 9999 to disable the check flat out.
# If the compiled world requires clients use a version higher than this, ci will fail.
# for instance: if this is set to 514, and a pr uses a 515 client feature, an alert will trigger
# If you have to update this number for your pr, you should make it VERY CLEAR in the pr body that you did so.
# (Requiring clients update to connect to the game server is not something we like to spring on them with no notice,
# especially for beta builds where the pager/updater won't let them update without additional configuration.)

514
290 changes: 290 additions & 0 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
name: CI Suite
on:
push:
branches:
- master
- 'project/**'
- 'gh-readonly-queue/master/**'
- 'gh-readonly-queue/project/**'
pull_request:
branches:
- master
- 'project/**'
merge_group:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run_linters:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Run Linters
runs-on: ubuntu-22.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: Restore SpacemanDMM cache
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-spacemandmm-
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore Node cache
uses: actions/cache@v4
with:
path: ~/.nvm
key: ${{ runner.os }}-node-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-node-
- 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') }}
- name: Python setup
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install OpenDream
uses: robinraju/[email protected]
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_node.sh
bash tools/ci/install_spaceman_dmm.sh dreamchecker
bash tools/ci/install_ripgrep.sh
tools/bootstrap/python -c ''
- name: Setup linters
id: linter-setup
run: ':'
- 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/beestation_dme.json
tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/unit_tests.json
- name: Check Define Sanity
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m define_sanity.check
- name: Check Trait Validity
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m trait_validity.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 beestation.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 beestation.dme
- 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 --ci lint tgui-test

compile_all_maps:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Compile Maps
needs: [collect_data]
runs-on: ubuntu-22.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: Restore BYOND cache
uses: actions/cache@v4
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-${{ hashFiles('dependencies.sh') }}
- name: Compile All Maps
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DCITESTING -DALL_MAPS
- name: Check client Compatibility
uses: tgstation/byond-client-compatibility-check@v3
with:
dmb-location: beestation.dmb
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}

collect_data:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Collect data for other tasks
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
maps: ${{ steps.map_finder.outputs.maps }}
alternate_tests: ${{ steps.alternate_test_finder.outputs.alternate_tests }}
max_required_byond_client: ${{ steps.max_required_byond_client.outputs.max_required_byond_client }}

steps:
- uses: actions/checkout@v4
- name: Find Maps
id: map_finder
run: |
echo "$(ls -mw0 _maps/*.json)" > maps_output.txt
sed -i -e s+_maps/+\"+g -e s+.json+\"+g maps_output.txt
echo "Maps: $(cat maps_output.txt)"
echo "maps={\"paths\":[$(cat maps_output.txt)]}" >> $GITHUB_OUTPUT
- name: Find Alternate Tests
id: alternate_test_finder
run: |
ALTERNATE_TESTS_JSON=$(jq -nRc '[inputs | capture("^(?<major>[0-9]+)\\.(?<minor>[0-9]+): (?<map>.+)$")]' .github/alternate_byond_versions.txt)
echo "alternate_tests=$ALTERNATE_TESTS_JSON" >> $GITHUB_OUTPUT
- name: Collect byond client version configuration
id: max_required_byond_client
#the regex here does not filter out non-numbers because error messages about no input are less helpful then error messages about bad input (which includes the bad input)
run: |
echo "max_required_byond_client=$(grep -Ev '^[[:blank:]]{0,}#{1,}|^[[:blank:]]{0,}$' .github/max_required_byond_client.txt | tail -n1)" >> $GITHUB_OUTPUT
run_all_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Integration Tests
needs: [collect_data]

strategy:
fail-fast: false
matrix:
map: ${{ fromJSON(needs.collect_data.outputs.maps).paths }}

uses: ./.github/workflows/run_integration_tests.yml
with:
map: ${{ matrix.map }}
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

run_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
name: Alternate Tests
needs: [collect_data]
strategy:
fail-fast: false
matrix:
setup: ${{ fromJSON(needs.collect_data.outputs.alternate_tests) }}

uses: ./.github/workflows/run_integration_tests.yml
with:
map: ${{ matrix.setup.map }}
major: ${{ matrix.setup.major }}
minor: ${{ matrix.setup.minor }}
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

check_alternate_tests:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && needs.collect_data.outputs.alternate_tests != '[]' )
name: Check Alternate Tests
needs: [run_alternate_tests, collect_data]
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- run: echo Alternate tests passed.

compare_screenshots:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && (always() && (!failure() && !cancelled())) )
needs: [run_all_tests, run_alternate_tests]
name: Compare Screenshot Tests
timeout-minutes: 15
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup directory
run: mkdir -p artifacts
# If we ever add more artifacts, this is going to break, but it'll be obvious.
- name: Download screenshot tests
uses: actions/download-artifact@v4
with:
path: artifacts
- name: ls -R
run: ls -R artifacts
- name: Setup screenshot comparison
run: npm i
working-directory: tools/screenshot-test-comparison
- name: Run screenshot comparison
run: node tools/screenshot-test-comparison/index.js artifacts code/modules/unit_tests/screenshots artifacts/screenshot_comparisons
# workflow_run does not give you the PR it ran on,
# even through the thing literally named "matching pull requests".
# However, in GraphQL, you can check if the check suite was ran
# by a specific PR, so trusting the (user controlled) action here is okay,
# as long as we check it later in show_screenshot_test_results
- name: Save PR ID
if: failure() && github.event.pull_request
run: |
echo ${{ github.event.pull_request.number }} > artifacts/screenshot_comparisons/pull_request_number.txt
- name: Upload bad screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: bad-screenshots
path: artifacts/screenshot_comparisons

test_windows:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Windows Build
needs: [collect_data]
runs-on: windows-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
run: pwsh tools/ci/build.ps1
env:
DM_EXE: "C:\\byond\\bin\\dm.exe"
- name: Check client Compatibility
uses: tgstation/byond-client-compatibility-check@v3
with:
dmb-location: beestation.dmb
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}
Loading

0 comments on commit 7640e0c

Please sign in to comment.