This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
[pull] master from Aurorastation:master #22
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: | |
merge_group: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
MACRO_COUNT: 0 | |
GENDER_COUNT: 6 | |
TO_WORLD_COUNT: 186 | |
BYOND_MAJOR: "" | |
BYOND_MINOR: "" | |
RUST_G_VERSION: "" | |
FLYWAY_BUILD: "" | |
SPACEMAN_DMM_VERSION: "" | |
NODE_VERSION: "" | |
NODE_VERSION_PRECISE: "" | |
PYTHON_VERSION: "" | |
jobs: | |
lint: | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
runs-on: ubuntu-22.04 | |
name: Run Linters | |
concurrency: | |
group: run_linters-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
# Clone Repo | |
- uses: actions/checkout@v3 | |
# Restore Caches | |
- name: Restore SpacemanDMM cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/SpacemanDMM | |
key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }} | |
- name: Restore OpenDream cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/OpenDream/* | |
key: ${{ runner.os }}-opendream | |
- name: Restore Yarn cache | |
uses: actions/cache@v3 | |
with: | |
path: tgui/.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# Install Dependencies | |
- name: "Set ENV variables" | |
run: bash dependencies.sh | |
- name: Restore Python Cache | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
cache-dependency-path: tgui/yarn.lock | |
node-version: ${{ env.NODE_VERSION_PRECISE }} | |
cache: 'yarn' | |
- name: Install Python Packages | |
run: | | |
pip install -r tools/requirements.txt | |
- name: Install Tools | |
run: | | |
pip3 install setuptools | |
bash tools/ci/install_spaceman_dmm.sh dreamchecker | |
bash tools/ci/install_od.sh | |
- name: Check Filedirs | |
run: | | |
bash tools/ci/check_filedirs.sh aurorastation.dme | |
- name: Check ChangeLogs | |
run: | | |
bash tools/ci/check_changelogs.sh | |
- name: Check Greps | |
run: | | |
bash tools/ci/check_grep.sh $PWD | |
- name: Check Validate DME | |
run: | | |
tools/bootstrap/python tools/validate_dme.py <aurorastation.dme | |
- name: Check Tgui | |
run: | | |
tools/build/build --ci lint tgui-test | |
- name: Check Defines | |
run: | | |
tools/bootstrap/python -m define_sanity.check | |
- name: Check Icons | |
run: | | |
tools/bootstrap/python -m dmi.test | |
- name: Check DMM-Test | |
run: | | |
tools/bootstrap/python -m mapmerge2.dmm_test | |
- name: Check Indentation | |
run: | | |
awk -f tools/indentation.awk **/*.dm | |
- name: Run OpenDream | |
run: | | |
tools/ci/run_od.sh | |
- name: Run Dreamchecker | |
run: | | |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1 | |
# bash tools/ci/check_misc.sh | |
# tools/bootstrap/python -m tools.maplint.source --github | |
- name: Annotate Lints | |
uses: yogstation13/DreamAnnotate@v2 | |
if: success() || failure() | |
with: | |
outputFile: output-annotations.txt | |
unit-test-linux: | |
if: ${{ !(contains(github.event.head_commit.message, '[ci skip]')) }} | |
strategy: | |
matrix: | |
map: [runtime, aurora, sccv_horizon, away_sites_testing, exoplanet_testing] | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: unit-test-linux-${{ github.head_ref || github.run_id }}-${{ matrix.map }} | |
cancel-in-progress: true | |
needs: lint | |
services: | |
mariadb: | |
image: mariadb:10.4 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: build | |
MYSQL_PASSWORD: build | |
MYSQL_DATABASE: game | |
MYSQL_ROOT_PASSWORD: root | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Set ENV variables" | |
run: source dependencies.sh | |
- name: Restore BYOND cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/BYOND/* | |
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} | |
- name: Restore FlyWay cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/flyway | |
key: ${{ runner.os }}-flyway-${{ env.FLYWAY_BUILD }} | |
- name: Prepare OS Environtment | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
- 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 | |
- name: Install OS Packages (Native) | |
run: | | |
sudo apt-get install libgcc-s1:i386 libssl-dev:i386 | |
- name: Install BYOND | |
run: | | |
source dependencies.sh | |
bash tools/ci/install_byond.sh | |
source $HOME/BYOND/byond/bin/byondsetup | |
bash tools/ci/install_rust_g.sh | |
- name: Install Flyway | |
run: | | |
tools/ci/install_flyway.sh | |
- name: Migrate database | |
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: Build | |
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 warnings" build_log.txt | |
- name: Run tests | |
env: | |
PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
export LD_LIBRARY_PATH=./:$PWD:$HOME/BYOND/byond/bin:/usr/local/lib:$LD_LIBRARY_PATH | |
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@v3 | |
with: | |
name: condensed-${{ matrix.map }}.log | |
path: ./data/logs/**/condensed.log | |
retention-days: 5 |