Skip to content

Commit

Permalink
tgs ci!
Browse files Browse the repository at this point in the history
  • Loading branch information
LetterN committed Mar 18, 2024
1 parent 2e66f56 commit e44e621
Show file tree
Hide file tree
Showing 19 changed files with 1,017 additions and 110 deletions.
7 changes: 7 additions & 0 deletions .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 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
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
2 changes: 1 addition & 1 deletion .github/workflows/auto_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run auto changelog
uses: actions/github-script@v6
with:
Expand Down
243 changes: 140 additions & 103 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,106 +4,116 @@ on:
branches:
- master
- 'project/**'
- 'gh-readonly-queue/master/**'
- 'gh-readonly-queue/project/**'
pull_request:
branches:
- master
- 'project/**'
merge_group:
branches:
- master
jobs:
run_linters:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Run Linters
runs-on: ubuntu-22.04
concurrency:
group: run_linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
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
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: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install/install_node.sh
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
with:
outputFile: output-annotations.txt
- name: CI - DMI Tests
if: always()
run: |
tools/bootstrap/python -m dmi.test
- name: CI - DMM Tests
if: always()
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
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: 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: Check Define Sanity
if: steps.linter-setup.conclusion == 'success' && !cancelled()
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 Map Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m mapmerge2.dmm_test
- 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:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Compile Maps
needs: [collect_data]
runs-on: ubuntu-22.04
concurrency:
group: compile_all_maps-${{ github.ref }}
group: compile_all_maps-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
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
Expand All @@ -112,44 +122,71 @@ jobs:
bash tools/ci/install/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: citadel.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
outputs:
alternate_tests: ${{ steps.alternate_test_finder.outputs.alternate_tests }}
max_required_byond_client: ${{ steps.max_required_byond_client.outputs.max_required_byond_client }}
concurrency:
group: find_all_maps-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- 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
concurrency:
group: run_all_tests-${{ github.ref }}
group: run_all_tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
uses: ./.github/workflows/run_integration_tests.yml
with:
max_required_byond_client: ${{needs.collect_data.outputs.max_required_byond_client}}

test_windows:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Windows Build
needs: [collect_data]
runs-on: windows-latest
concurrency:
group: test_windows-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
runs-on: ubuntu-22.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
- uses: actions/checkout@v4
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: ~/BYOND
key: ${{ runner.os }}-byond
- name: Setup database
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'CREATE DATABASE ss13_ci;'
mysql -u root -proot ss13_ci < SQL/database_schema_prefixed.sql
mysql -u root -proot ss13_ci < SQL/unified_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: |
bash tools/ci/install/install_rust_g.sh
- name: Compile and run tests
run: |
bash tools/ci/install/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DCITESTING
bash tools/ci/run_server.sh
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"
- name: Check client Compatibility
uses: tgstation/byond-client-compatibility-check@v3
with:
dmb-location: citadel.dmb
max-required-client-version: ${{needs.collect_data.outputs.max_required_byond_client}}
2 changes: 1 addition & 1 deletion .github/workflows/codeowner_reviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

#Parse the Codeowner file on non draft PRs
- name: CodeOwnersParser
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compile_changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
compile:
name: "Compile changelogs"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: "Check for ACTION_ENABLER secret and pass true to output if it exists to be checked by later steps"
id: value_holder
Expand All @@ -31,7 +31,7 @@ jobs:
sudo apt-get install dos2unix
- name: "Checkout"
if: steps.value_holder.outputs.ACTIONS_ENABLED
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 25
persist-credentials: false
Expand Down
Loading

0 comments on commit e44e621

Please sign in to comment.