Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DaedalusDock/daedalusdock into pr…
Browse files Browse the repository at this point in the history
…oject/atlas
  • Loading branch information
Kapu1178 committed Jun 5, 2023
2 parents e49670e + 7c56763 commit 5d5de5f
Show file tree
Hide file tree
Showing 2,437 changed files with 88,280 additions and 71,926 deletions.
9 changes: 9 additions & 0 deletions .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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.1603: runtimestation
2 changes: 1 addition & 1 deletion .github/guides/HARDDELETES.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Here's an example
UnregisterSignal(target, COMSIG_PARENT_QDELETING) //We need to make sure any old signals are cleared
target = new_target
if(target)
RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_target) //Call clear_target if target is ever qdel()'d
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_target)) //Call clear_target if target is ever qdel()'d
/somemob/proc/clear_target(datum/source)
SIGNAL_HANDLER
Expand Down
42 changes: 42 additions & 0 deletions .github/guides/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,48 @@ While we normally encourage (and in some cases, even require) bringing out of da

* Files and path accessed and referenced by code above simply being #included should be strictly lowercase to avoid issues on filesystems where case matters.

When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF,TYPE_PROC_REF and GLOBAL_PROC_REF macros.
They ensure compilation fails if the reffered to procs change names or get removed.
The macro to be used depends on how the proc you're in relates to the proc you want to use:

### RegisterSignal()

#### PROC_REF Macros

PROC_REF if the proc you want to use is defined on the current proc type or any of it's ancestor types.
Example:
```
/mob/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/very_funny()
to_chat(world,"who's there?")
/mob/subtype/proc/do_something()
// Proc on our own type
RegisterSignal(x, COMSIG_OTHER_FAKE, PROC_REF(very_funny))
// Proc on ancestor type, /mob is parent type of /mob/subtype
RegisterSignal(x, COMSIG_FAKE, PROC_REF(funny))
```

TYPE_PROC_REF if the proc you want to use is defined on a different unrelated type
Example:
```
/obj/thing/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/do_something()
var/obj/thing/x = new()
// we're referring to /obj/thing proc inside /mob/subtype proc
RegisterSignal(x, COMSIG_FAKE, TYPE_PROC_REF(/obj/thing, funny))
```

GLOBAL_PROC_REF if the proc you want to use is a global proc.
Example:
```
/proc/funny()
to_chat(world,"knock knock")
/mob/subtype/proc/do_something()
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(funny)), 100))
```

### Signal Handlers

All procs that are registered to listen for signals using `RegisterSignal()` must contain at the start of the proc `SIGNAL_HANDLER` eg;
Expand Down
84 changes: 38 additions & 46 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
runs-on: ubuntu-20.04
outputs:
maps: ${{ steps.map_finder.outputs.maps }}
alternate_tests: ${{ steps.alternate_test_finder.outputs.alternate_tests }}
concurrency:
group: find_all_maps-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- name: Find Maps
Expand All @@ -83,67 +87,55 @@ jobs:
sed -i -e s+_maps/+\"+g -e s+.json+\"+g maps_output.txt
echo "Maps: $(cat maps_output.txt)"
echo "::set-output name=maps::{\"paths\":[$(cat maps_output.txt)]}"
- 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
run_all_tests:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Integration Tests
runs-on: ubuntu-20.04
needs: [find_all_maps]
strategy:
fail-fast: false
matrix:
map: ${{ fromJSON(needs.find_all_maps.outputs.maps).paths }}
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
concurrency:
group: ci-${{ github.ref }}-${{ matrix.map }}
group: un_all_tests-${{ github.head_ref || github.run_id }}-${{ matrix.map }}
cancel-in-progress: true
uses: ./.github/workflows/run_integration_tests.yml
with:
map: ${{ matrix.map }}

run_alternate_tests:
if: "!contains(github.event.head_commit.message, '[ci skip]') && needs.find_all_maps.outputs.alternate_tests != '[]'"
name: Alternate Tests
needs: [find_all_maps]
strategy:
fail-fast: false
matrix:
setup: ${{ fromJSON(needs.find_all_maps.outputs.alternate_tests) }}
concurrency:
group: run_all_tests-${{ github.head_ref || github.run_id }}-${{ matrix.setup.major }}.${{ matrix.setup.minor }}-${{ matrix.setup.map }}
cancel-in-progress: true
uses: ./.github/workflows/run_integration_tests.yml
with:
map: ${{ matrix.setup.map }}
major: ${{ matrix.setup.major }}
minor: ${{ matrix.setup.minor }}

check_alternate_tests:
if: "!contains(github.event.head_commit.message, '[ci skip]') && needs.find_all_maps.outputs.alternate_tests != '[]'"
name: Check Alternate Tests
needs: [run_alternate_tests]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Restore BYOND cache
uses: actions/cache@v2
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
- name: Setup database
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'CREATE DATABASE tg_ci;'
mysql -u root -proot tg_ci < SQL/tgstation_schema.sql
mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;'
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Compile Tests
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS
- name: Run Tests
run: |
source $HOME/BYOND/byond/bin/byondsetup
bash tools/ci/run_server.sh ${{ matrix.map }}
- name: Upload screenshot tests
if: always()
uses: actions/upload-artifact@v3
with:
name: test_artifacts_${{ matrix.map }}
path: data/screenshots_new/
retention-days: 1
- run: echo Alternate tests passed.

compare_screenshots:
if: "!contains(github.event.head_commit.message, '[ci skip]') && always()"
needs: [run_all_tests]
needs: [run_all_tests, run_alternate_tests]
name: Compare Screenshot Tests
runs-on: ubuntu-20.04
steps:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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
jobs:
run_integration_tests:
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Restore BYOND cache
uses: actions/cache@v3
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
- name: Setup database
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'CREATE DATABASE tg_ci;'
mysql -u root -proot tg_ci < SQL/tgstation_schema.sql
mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;'
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Configure version
run: |
echo "BYOND_MAJOR=${{ inputs.major }}" >> $GITHUB_ENV
echo "BYOND_MINOR=${{ inputs.minor }}" >> $GITHUB_ENV
if: ${{ inputs.major }}
- name: Compile Tests
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS -Werror
- name: 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@v3
with:
name: test_artifacts_${{ inputs.map }}
path: data/screenshots_new/
retention-days: 1
2 changes: 1 addition & 1 deletion _maps/RandomRuins/AnywhereRuins/golem_ship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
/obj/item/storage/medkit/brute,
/obj/structure/table/wood,
/obj/item/storage/medkit/brute,
/obj/item/disk/design_disk/golem_shell,
/obj/item/disk/data/golem_shell,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"E" = (
Expand Down
29 changes: 10 additions & 19 deletions _maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
/turf/open/floor/iron,
/area/ruin/planetengi)
"aA" = (
/obj/machinery/rnd/production/protolathe/department/engineering,
/obj/machinery/rnd/production/fabricator/department/engineering,
/obj/effect/turf_decal/trimline/yellow/filled/warning{
dir = 9
},
Expand Down Expand Up @@ -541,14 +541,8 @@
/obj/item/mod/control/pre_equipped/engineering,
/obj/effect/decal/cleanable/blood/old,
/obj/structure/cable,
/turf/open/floor/iron{
icon_state = "damaged3"
},
/area/ruin/planetengi)
"cM" = (
/turf/open/floor/iron{
icon_state = "damaged2"
},
/obj/effect/mapping_helpers/broken_floor,
/turf/open/floor/iron,
/area/ruin/planetengi)
"cO" = (
/obj/machinery/atmospherics/pipe/heat_exchanging/simple{
Expand Down Expand Up @@ -596,9 +590,8 @@
/turf/open/floor/iron,
/area/ruin/planetengi)
"cW" = (
/turf/open/floor/iron{
icon_state = "damaged1"
},
/obj/effect/mapping_helpers/broken_floor,
/turf/open/floor/iron,
/area/ruin/planetengi)
"cX" = (
/obj/structure/cable,
Expand All @@ -610,9 +603,8 @@
"cY" = (
/obj/item/stack/sheet/plasmarglass,
/obj/item/card/id/advanced/engioutpost,
/turf/open/floor/iron{
icon_state = "damaged4"
},
/obj/effect/mapping_helpers/broken_floor,
/turf/open/floor/iron,
/area/ruin/planetengi)
"cZ" = (
/obj/machinery/atmospherics/pipe/smart/simple/scrubbers/visible{
Expand Down Expand Up @@ -664,9 +656,8 @@
/area/ruin/planetengi)
"dk" = (
/obj/effect/turf_decal/trimline/yellow/filled/line,
/turf/open/floor/iron{
icon_state = "damaged5"
},
/obj/effect/mapping_helpers/broken_floor,
/turf/open/floor/iron,
/area/ruin/planetengi)
"dl" = (
/obj/effect/mob_spawn/corpse/human/engineer/mod,
Expand Down Expand Up @@ -1136,7 +1127,7 @@ bH
bZ
cj
bB
cM
cW
cY
dj
cG
Expand Down
Loading

0 comments on commit 5d5de5f

Please sign in to comment.