Files
CHOMPStation2/.github/workflows/ci.yml
2025-07-11 15:35:20 +02:00

164 lines
5.0 KiB
YAML

name: CI
on:
pull_request:
branches:
- master
env:
BASENAME: "vorestation"
jobs:
run_linters:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Run Linters
runs-on: ubuntu-24.04
concurrency:
group: run_linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Caches
- name: Setup Bun
uses: ./.github/actions/setup_bun
- 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: Restore Cutter cache
uses: actions/cache@v4
with:
path: tools/icon_cutter/cache
key: ${{ runner.os }}-cutter-${{ hashFiles('dependencies.sh') }}
# End Caches
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_ripgrep.sh
bash tools/ci/install_spaceman_dmm.sh dmm-tools
tools/bootstrap/python -c ''
- name: Run Validation Tests
run: bash tools/ci/validate_files.sh
- name: Run Define Sanity Checks
run: tools/bootstrap/python -m define_sanity.check
- name: Run DMI Tests
run: tools/bootstrap/python -m dmi.test
- name: Run Map Checks
run: |
tools/bootstrap/python -m tools.maplint.source
tools/bootstrap/python -m mapmerge2.dmm_test
- name: Run TGUI Checks
run: tools/build/build.sh --ci lint tgui-test
- name: Run Nanomap Checks
run: tools/github-actions/nanomap-renderer-invoker.sh --testing
dreamchecker:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: DreamChecker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Restore SpacemanDMM Cache
uses: actions/cache@v4
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
restore-keys: ${{ runner.os }}-dreamchecker
- name: Install Dependencies
run: |
tools/ci/install_spaceman_dmm.sh dreamchecker
- name: Run Linter
id: linter
run: |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Linter
uses: yogstation13/DreamAnnotate@v2
if: always()
with:
outputFile: output-annotations.txt
odlint:
name: Lint with OpenDream
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9
- uses: actions/checkout@v4
- uses: robinraju/release-downloader@v1.12
with:
repository: "OpenDreamProject/OpenDream"
tag: "latest"
fileName: "DMCompiler_linux-x64.tar.gz"
extract: true
- run: ./DMCompiler_linux-x64/DMCompiler --suppress-unimplemented vorestation.dme
unit_tests:
timeout-minutes: 30
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
strategy:
matrix:
map: ['USE_MAP_SOUTHERN_CROSS', 'USE_MAP_SOLUNA_NEXUS']
# name: Integration Tests (${{ matrix.map }})
name: Integration Tests
# needs: ['run_linters', 'dreamchecker']
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Ensure +x on CI directory
run: |
chmod -R +x ./tools/ci
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
major: ${{ inputs.major }}
minor: ${{ inputs.minor }}
- name: Install RUST_G Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install zlib1g-dev:i386
ldd librust_g.so
ldd libbapi_dmm_reader.so
ldd libverdigris.so
- name: Unit Tests
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DUNIT_TEST -D${{ matrix.map }}"
RUN: "1"
- name: Compile POIs
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DMAP_TEST -D${{ matrix.map }}"
RUN: "0"
- name: Compile away missions
run: tools/ci/compile_and_run.sh
env:
EXTRA_ARGS: "-DAWAY_MISSION_TEST -D${{ matrix.map }}"
RUN: "0"
tests_successful:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Integration Tests
needs: ['run_linters', 'dreamchecker', 'unit_tests']
runs-on: ubuntu-24.04
steps:
- name: Report Success
run: |
echo "Jobs Successful!"