mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
149 lines
4.4 KiB
YAML
149 lines
4.4 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-22.04
|
|
concurrency:
|
|
group: run_linters-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# Caches
|
|
- name: Ensure +x on CI directory
|
|
run: |
|
|
chmod -R +x ./tools/ci
|
|
- name: Restore SpacemanDMM cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/SpacemanDMM
|
|
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
|
|
restore-keys: |
|
|
${{ 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 Node cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
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: 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_build_deps.sh
|
|
bash tools/ci/install_ripgrep.sh
|
|
bash tools/ci/install_spaceman_dmm.sh dreamchecker
|
|
tools/bootstrap/python -c ''
|
|
- name: Run Tests
|
|
run: |
|
|
tools/ci/validate_files.sh
|
|
- name: Run DreamChecker
|
|
shell: bash
|
|
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
|
|
- name: Run TGUI Checks
|
|
run: tools/build/build --ci lint tgui-test
|
|
|
|
unit_tests:
|
|
timeout-minutes: 30
|
|
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
|
|
strategy:
|
|
matrix:
|
|
map: ['southern_cross']
|
|
# name: Integration Tests (${{ matrix.map }})
|
|
name: Integration Tests
|
|
# needs: ['run_linters', 'dreamchecker']
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Ensure +x on CI directory
|
|
run: |
|
|
chmod -R +x ./tools/ci
|
|
- name: Setup Cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: $HOME/BYOND
|
|
key: ${{ runner.os }}-byond
|
|
- name: Install RUST_G Dependencies
|
|
run: |
|
|
sudo dpkg --add-architecture i386
|
|
sudo apt update || true
|
|
sudo apt install gcc-multilib
|
|
sudo apt install zlib1g-dev:i386 libssl-dev:i386
|
|
ldd librust_g.so
|
|
ldd libverdigris.so
|
|
- name: Unit Tests
|
|
run: |
|
|
tools/ci/install_byond.sh
|
|
tools/ci/compile_and_run.sh
|
|
env:
|
|
TEST_DEFINE: "UNIT_TEST"
|
|
TEST_FILE: "code/_unit_tests.dm"
|
|
MAP: ${{ matrix.map }}
|
|
REPLACE: true
|
|
RUN: "1"
|
|
- name: Compile POIs
|
|
run: |
|
|
tools/ci/install_byond.sh
|
|
tools/ci/compile_and_run.sh
|
|
env:
|
|
TEST_DEFINE: "MAP_TEST"
|
|
TEST_FILE: "code/_map_tests.dm"
|
|
MAP: ${{ matrix.map }}
|
|
REPLACE: false
|
|
RUN: "0"
|
|
- name: Compile away missions
|
|
run: |
|
|
tools/ci/install_byond.sh
|
|
tools/ci/compile_and_run.sh
|
|
env:
|
|
TEST_DEFINE: "AWAY_MISSION_TEST"
|
|
TEST_FILE: "code/_away_mission_tests.dm"
|
|
MAP: ${{ matrix.map }}
|
|
REPLACE: false
|
|
RUN: "0"
|
|
|
|
tests_successful:
|
|
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
|
|
name: Integration Tests
|
|
needs: ['run_linters', 'unit_tests']
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Report Success
|
|
run: |
|
|
echo "Jobs Successful!"
|