Autolathe Stuff (#19194) #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Suite | |
on: | |
workflow_dispatch: | |
merge_group: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
MACRO_COUNT: 0 | |
GENDER_COUNT: 6 | |
TO_WORLD_COUNT: 179 | |
#These variables are filled from dependencies.sh inside the steps, DO NOT SET THEM HERE | |
BYOND_MAJOR: "" | |
BYOND_MINOR: "" | |
RUST_G_VERSION: "" | |
FLYWAY_BUILD: "" | |
SPACEMAN_DMM_VERSION: "" | |
NODE_VERSION: "" | |
NODE_VERSION_LTS: "" | |
PYTHON_VERSION: "" | |
#If we want the runner to open an SSH shell for us to inspect it, fairly nieche, don't touch if you don't know what you're doing | |
RUNNER_DEBUG_SHELL: false | |
#This is used to know what triggered the jobs for running | |
CI_TRIGGER_REASON: ${{ github.event_name }} | |
#The maximum number of retries the unit tests (excluding linters) can make, if appropriate for them to | |
CI_MAX_RETRIES: 3 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
########################################### | |
################# BASH/AWK ################ | |
########################################### | |
validate-structure: | |
name: Validate Structure | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
concurrency: | |
group: validate-structure-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Validate that we have everything to run, structure-wise: files, changelog, grep and indentation | |
- name: "Validate repository structure" | |
run: | | |
bash tools/ci/check_filedirs.sh aurorastation.dme | |
bash tools/ci/check_changelogs.sh | |
bash tools/ci/check_grep.sh $PWD | |
awk -f tools/indentation.awk **/*.dm | |
########################################### | |
############### EditorConfig ############## | |
########################################### | |
megalinter: | |
name: Validate EditorConfig Compliance | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
concurrency: | |
group: megalinter-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
APPLY_FIXES: EDITORCONFIG | |
APPLY_FIXES_EVENT: all | |
APPLY_FIXES_MODE: commit | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
# We use megalinter for this because it's fairly well updated and used | |
# https://megalinter.io/latest/ | |
- name: Check EditorConfig Compliance | |
id: ml | |
uses: oxsecurity/megalinter/flavors/[email protected] | |
# Env config options outlined in https://megalinter.io/configuration/ | |
env: | |
PRINT_ALPACA: false | |
VALIDATE_ALL_CODEBASE: false | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ENABLE: EDITORCONFIG | |
EXCLUDED_DIRECTORIES: tools/bootstrap/.cache/ | |
FILTER_REGEX_INCLUDE: (.*\.dm$|.*\.dme$|.*\.sql$) | |
# Upload MegaLinter artifacts | |
- name: Upload Megalinter Artifacts | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MegaLinter reports | |
path: | | |
megalinter-reports | |
mega-linter.log | |
retention-days: 5 | |
########################################### | |
############### SPACEMANDMM ############### | |
########################################### | |
lint-spacemandmm: | |
name: Lint SpacemanDMM | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
needs: validate-structure | |
concurrency: | |
group: lint-spacemandmm-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores SpacemanDMM from the cache repository | |
- name: Restore SpacemanDMM cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/SpacemanDMM | |
key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }} | |
- name: Install SpacemanDMM | |
run: | | |
bash tools/ci/install_spaceman_dmm.sh dreamchecker | |
#Run SpacemanDMM | |
- name: Run Dreamchecker | |
run: | | |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1 | |
#Annotate findings in the PR | |
- name: Annotate Lints | |
uses: yogstation13/DreamAnnotate@v2 | |
if: success() || failure() | |
with: | |
outputFile: output-annotations.txt | |
########################################### | |
################ OPENDREAM ################ | |
########################################### | |
lint-opendream: | |
name: Lint OpenDream | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
needs: validate-structure | |
concurrency: | |
group: lint-opendream-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
- name: Download OpenDream Compiler | |
run: | | |
bash tools/ci/install_od.sh | |
- name: Run OpenDream | |
run: | | |
tools/ci/run_od.sh | |
########################################### | |
############### TGUI LINTING ############## | |
########################################### | |
lint-tgui: | |
name: Lint TGUI | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
needs: validate-structure | |
concurrency: | |
group: lint-tgui-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restore YARN (Node packages) cache | |
- 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 }}-build- | |
${{ runner.os }}- | |
#Setup NodeJS using YARN as cache | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
cache-dependency-path: tgui/yarn.lock | |
node-version: ${{ env.NODE_VERSION_LTS }} | |
cache: 'yarn' | |
#Lint TGUI | |
- name: Check Tgui | |
run: | | |
tools/build/build --ci lint tgui-test | |
########################################### | |
############### MISC LINTING ############## | |
########################################### | |
lint-misc: | |
name: Lint Misc | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
needs: validate-structure | |
concurrency: | |
group: lint-misc-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores python cache | |
- name: Restore Python Cache | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
#Install python packages and tools | |
- name: Install Python Packages | |
run: | | |
pip install -r tools/requirements.txt | |
pip3 install setuptools | |
- name: Check Validate DME | |
run: | | |
tools/bootstrap/python tools/validate_dme.py <aurorastation.dme | |
- name: Check Defines | |
run: | | |
tools/bootstrap/python -m define_sanity.check | |
- name: Check Icons | |
run: | | |
tools/bootstrap/python -m dmi.test | |
- name: Run Map Checks | |
run: | | |
tools/bootstrap/python -m mapmerge2.dmm_test | |
tools/bootstrap/python -m tools.maplint.source | |
- name: Scan DMMs | |
run: | | |
tools/bootstrap/python -m dmm_scanner.scan_camera_ctags | |
########################################### | |
############## GENERIC TESTS ############## | |
########################################### | |
generic-tests: | |
name: Generic Tests | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-generic-tests-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [away_sites_testing] | |
pod: [generic] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 | |
########################################### | |
########### CREATE AND DESTROY ############ | |
########################################### | |
create-and-destroy: | |
name: Create and Destroy Test | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-create-and-destroy-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [away_sites_testing] | |
pod: [create_and_destroy] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 | |
########################################### | |
################ TEST MAPS ################ | |
########################################### | |
map-tests: | |
name: Run Map Tests | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-map-tests-${{ matrix.map }}-${{ matrix.pod }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [runtime, sccv_horizon, exoplanet_testing] | |
pod: [maptest] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 | |
########################################### | |
############# EXOPLANETS TESTS ############ | |
########################################### | |
exoplanet_testing: | |
name: Run Exoplanet Tests | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-exoplanet_testing-${{ matrix.map }}-${{ matrix.pod }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [exoplanet_testing] | |
pod: [exoplanet_testing-1, exoplanet_testing-2, exoplanet_testing-3] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 | |
########################################### | |
############# TEST AWAY SITES ############# | |
########################################### | |
away-sites-tests: | |
name: Run Map Tests | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-away-sites-tests-${{ matrix.map }}-${{ matrix.pod }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [away_sites_testing] | |
pod: [awaysites-1, awaysites-2, awaysites-3] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 | |
########################################### | |
################ TEST RUINS ############### | |
########################################### | |
ruins-tests: | |
name: Run Ruins Tests | |
runs-on: ubuntu-22.04 | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) && !(contains(github.event.head_commit.message, '[ut skip]'))}} | |
needs: [validate-structure, lint-spacemandmm, lint-opendream, lint-tgui, lint-misc] | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
concurrency: | |
group: unit-tests-ruins-tests-${{ matrix.map }}-${{ matrix.pod }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
map: [runtime] | |
pod: [ruins-1, ruins-2, ruins-3] | |
fail-fast: false | |
steps: | |
#This allows us to SSH into the pod, and it's only enabled if we're running in debug mode | |
- name: Setup TMATE session (Debug only) | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ env.RUNNER_DEBUG_SHELL == true }} | |
with: | |
detached: true | |
timeout-minutes: 5 | |
#Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#Initialize the environment variables | |
- name: Set ENV variables | |
run: bash dependencies.sh | |
#Restores BYOND cache | |
- name: Restore BYOND cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
#Add the x86 architecture and update apt-get's local indexes | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
#Installs the packages we need, from a cache | |
- name: Install OS Packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-multilib zlib1g-dev:i386 libssl-dev:i386 libgcc-s1:i386 libc6:i386 | |
version: 1.1 | |
#And natively, the packages that break from a cache | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
#Install flyway | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
#Apply the database migration | |
- name: Apply Database Migrations (FlyWay) | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
$HOME/flyway/flyway-$FLYWAY_BUILD/flyway migrate -user=root -password=root -url="jdbc:mariadb://localhost:$PORT/game" -validateMigrationNaming="true" | |
- name: Install BYOND & rust_g | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Configure pod, build and run | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
POD: ${{ matrix.pod }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
scripts/dm.sh -DUNIT_TEST -M${{ matrix.map }} aurorastation.dme | |
grep "0 errors, 1 warning" build_log.txt | |
echo -n "$POD" > config/unit_test/identifier.txt | |
cp config/example/* config/ && cp config/ut/config-db.txt config/config.txt && cp config/ut/dbconfig.txt config/dbconfig.txt | |
echo "PORT $PORT" >> config/dbconfig.txt | |
$HOME/BYOND/byond/bin/DreamDaemon aurorastation.dmb -invisible -trusted -core 2>&1 | tee log.txt | |
grep "All Unit Tests Passed" log.txt | |
(! grep "runtime error:" log.txt) | |
- name: Upload Condensed UT Log | |
uses: actions/upload-artifact@v4 | |
if: failure() || ${{ runner.debug }} | |
with: | |
name: condensed-${{ matrix.map }}-${{ matrix.pod }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 |