Skip to content

Commit

Permalink
Merge branch 'master' into soulcatcher-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLordME authored Nov 5, 2024
2 parents 7a7c0ee + 8a2b3f5 commit 996185e
Show file tree
Hide file tree
Showing 385 changed files with 99,691 additions and 96,974 deletions.
218 changes: 131 additions & 87 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,121 +4,132 @@ on:
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:
start_gate:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Start Gate
runs-on: ubuntu-latest
steps:
- name: Mandatory Empty Step
run: exit 0

run_linters:
name: Run Linters
needs: start_gate
runs-on: ubuntu-22.04
concurrency:
group: run_linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
timeout-minutes: 10

steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Restore Bootstrap cache
uses: actions/cache@v3
- uses: actions/checkout@v4
- name: Restore SpacemanDMM cache
uses: actions/cache@v4
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap-${{ hashFiles('dependencies.sh', 'tools/requirements.txt') }}
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-bootstrap-
- name: Restore Rust / Cargo cache
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-
- name: Restore TGUI / Yarn cache
uses: actions/cache@v3
${{ 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 SpacemanDMM cache
uses: actions/cache@v3
- name: Restore Node cache
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm-${{hashFiles('dependencies.sh')}}
- name: Install Node
run: |
tools/bootstrap/node --version
- name: Install Python
run: |
tools/bootstrap/python --version
- name: Install SpacemanDMM Suite
run: |
bash tools/ci/install/install_spaceman_dmm.sh dreamchecker
- name: Install Ripgrep
run: |
cargo install ripgrep --features pcre2
# - name: Install Setuptools
# run: |
# pip3 install setuptools
- name: CI - Parse DM (dreamchecker)
run: |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: CI - Annotate DM (dreamchecker)
if: always()
uses: yogstation13/DreamAnnotate@v2
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:
outputFile: output-annotations.txt
- name: CI - DMI Tests
if: always()
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('tools/ci/ci_dependencies.sh')}}
restore-keys: |
${{ runner.os }}-rust-
- name: Install Tools
run: |
tools/bootstrap/python -m dmi.test
- name: CI - DMM Tests
if: always()
bash tools/ci/install_node.sh
bash tools/ci/install/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: Run Grep Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_grep.sh
- name: Run DreamChecker
if: steps.linter-setup.conclusion == 'success' && !cancelled()
shell: bash
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
- name: Run Map Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
tools/bootstrap/python -m mapmerge2.dmm_test
- name: CI - TGUI
if: always()
run: |
tools/build/build --ci lint tgui-test
- name: CI - Grep (string checks)
if: always()
run: |
tools/ci/check_grep.sh
- name: CI - Changelogs
if: always()
run: |
tools/ci/check_changelogs.sh
- name: CI - DME Validation
if: always()
run: |
tools/ci/check_filedirs.sh citadel.dme
- name: CI - Misc
if: always()
run: |
bash tools/ci/check_misc.sh
- 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 citadel.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 --ci lint tgui-test

compile_all_maps:
name: Compile Maps
needs: start_gate
runs-on: ubuntu-22.04
concurrency:
group: compile_all_maps-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Setup cache
uses: actions/cache@v3
- uses: actions/checkout@v4
- name: Restore BYOND cache
uses: actions/cache@v4
with:
path: ~/BYOND
key: ${{ runner.os }}-byond
- name: Compile All Maps
key: ${{ runner.os }}-byond-${{ hashFiles('dependencies.sh') }}
- name: Compile "All" Maps
run: |
bash tools/ci/install/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DCITESTING -DALL_MAPS
run_all_tests:
run_integration_tests:
name: Integration Tests
concurrency:
group: run_all_tests-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-22.04
needs: start_gate
runs-on: ubuntu-latest
timeout-minutes: 15
services:
mysql:
image: mysql:latest
Expand All @@ -128,12 +139,12 @@ jobs:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Restore BYOND cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/BYOND
key: ${{ runner.os }}-byond
key: ${{ runner.os }}-byond-${{ hashFiles('dependencies.sh') }}
- name: Setup database
run: |
sudo systemctl start mysql
Expand All @@ -145,11 +156,44 @@ jobs:
- name: Install rust-g
run: |
bash tools/ci/install/install_rust_g.sh
- name: Compile and run tests
- name: Compile Tests
id: compile_tests
run: |
bash tools/ci/install/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DCITESTING
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS -Werror -ITG0001 -I"loop_checks"
- name: Run Tests
run: |
source $HOME/BYOND/byond/bin/byondsetup
bash tools/ci/run_server.sh
test_windows:
name: Windows Build
needs: start_gate
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:
CBT_BUILD_MODE: TEST_RUN
DM_EXE: "C:\\byond\\bin\\dm.exe"

completion_gate: # Serves as a non-moving target for branch rulesets
if: always() && !cancelled()
name: Completion Gate
needs: [ test_windows, run_integration_tests, compile_all_maps, run_linters ]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
],
"typescript.tsdk": "./tgui/.yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
Expand Down
8 changes: 7 additions & 1 deletion citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\vector.dm"
#include "code\__HELPERS\verbs.dm"
#include "code\__HELPERS\visual_effects.dm"
#include "code\__HELPERS\animations\attack.dm"
#include "code\__HELPERS\datastructs\bodytypes.dm"
#include "code\__HELPERS\datastructs\filters.dm"
Expand Down Expand Up @@ -530,7 +531,10 @@
#include "code\controllers\configuration_old\configuration.dm"
#include "code\controllers\configuration_old\configuration_vr.dm"
#include "code\controllers\observer_listener\atom\observer.dm"
#include "code\controllers\repository\designs.dm"
#include "code\controllers\repository\guidebook.dm"
#include "code\controllers\repository\material_traits.dm"
#include "code\controllers\repository\materials.dm"
#include "code\controllers\repository\structs.dm"
#include "code\controllers\subsystem\ai_holders.dm"
#include "code\controllers\subsystem\ai_legacy.dm"
Expand Down Expand Up @@ -586,7 +590,6 @@
#include "code\controllers\subsystem\preferences.dm"
#include "code\controllers\subsystem\radiation.dm"
#include "code\controllers\subsystem\repository.dm"
#include "code\controllers\subsystem\research.dm"
#include "code\controllers\subsystem\server_maint.dm"
#include "code\controllers\subsystem\shuttles.dm"
#include "code\controllers\subsystem\simple_networks.dm"
Expand Down Expand Up @@ -4662,6 +4665,7 @@
#include "code\modules\reagents\reagent_containers\glass\bottle_vr.dm"
#include "code\modules\research\design.dm"
#include "code\modules\research\research.dm"
#include "code\modules\research\tech.dm"
#include "code\modules\research\designs\ai_holders.dm"
#include "code\modules\research\designs\bag_of_holding.dm"
#include "code\modules\research\designs\beakers.dm"
Expand Down Expand Up @@ -4700,6 +4704,8 @@
#include "code\modules\research\designs\circuits\machines\chemistry.dm"
#include "code\modules\research\designs\circuits\machines\misc.dm"
#include "code\modules\research\designs\circuits\machines\nanites.dm"
#include "code\modules\research\items\design_disk.dm"
#include "code\modules\research\items\tech_disk.dm"
#include "code\modules\research\machinery\circuitprinter.dm"
#include "code\modules\research\machinery\destructive_analyzer.dm"
#include "code\modules\research\machinery\protolathe.dm"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/_cooldowns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time))

/// Checks if a timer based cooldown is NOT finished.
#define TIMER_COOLDOWN_CHECK(cd_source, cd_index) LAZYACCESS(cd_source.cooldowns, cd_index)

#define TIMER_COOLDOWN_END(cd_source, cd_index) LAZYREMOVE(cd_source.cooldowns, cd_index)
Expand Down Expand Up @@ -86,3 +87,6 @@
//? Structures
//* /obj/structure/sculpting_block
#define CD_INDEX_SCULPTING_COOLDOWN "sculpting_block"

// admin verb cooldowns
#define CD_INTERNET_SOUND "internet_sound"
6 changes: 5 additions & 1 deletion code/__DEFINES/_tick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#define CHECK_TICK ( TICK_CHECK ? stoplag() : 0 )

/// Returns true if tick usage is above 95, for high priority usage
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 )
///
/// * Use for admin functions so they stay responsive and functional during lag.
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 99 )
/// runs stoplag if tick_usage is above 95, for high priority usage
///
/// * Use for admin functions so they stay responsive and functional during lag.
#define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY? stoplag() : 0 )
26 changes: 17 additions & 9 deletions code/__DEFINES/controllers/_repositories.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2023 Citadel Station developers. *//
//* Copyright (c) 2024 Citadel Station Developers *//

//* This is here in [code/__DEFINES/controllers/_repositories.dm] for compile order reasons. *//
/datum/controller/subsystem/repository/proc/__create_repositories()

//* This is here in [code/__DEFINES/controllers/_repositories.dm] for compile order reasons. *//
/datum/controller/subsystem/repository/proc/__init_repositories()

// todo: redo recover logic; maybe /datum/controller as a whole should be brushed up
#define REPOSITORY_DEF(what) \
GLOBAL_REAL(RC##what, /datum/controller/repository/##what); \
GLOBAL_REAL(RS##what, /datum/controller/repository/##what); \
/datum/controller/repository/##what/New(){ \
if(global.RC##what != src && istype(global.RC##what)){ \
Recover(global.RC##what); \
qdel(global.RC##what); \
if(global.RS##what != src && istype(global.RS##what)){ \
Recover(global.RS##what); \
qdel(global.RS##what); \
} \
global.RC##what = src; \
global.RS##what = src; \
} \
/datum/controller/subsystem/repository/var/datum/controller/repository/##what/RS##what; \
/datum/controller/subsystem/repository/__create_repositories() { \
..(); \
RS##what = new; \
RS##what.Create(); \
} \
/datum/controller/subsystem/repository/var/datum/controller/repository/##what/RC##what; \
/datum/controller/subsystem/repository/__init_repositories() { \
..(); \
RC##what = new; \
RC##what.Initialize(); \
RS##what.Initialize(); \
} \
/datum/controller/repository/##what
Loading

0 comments on commit 996185e

Please sign in to comment.