forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 0
213 lines (201 loc) · 6.88 KB
/
ci.yml
File metadata and controls
213 lines (201 loc) · 6.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
jobs:
run_linters:
name: Run Linters
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Setup Cache
uses: actions/cache@v5
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-spacemandmm
- name: Install Tools
run: |
bash tools/ci/install_build_deps.sh
bash tools/ci/install_dreamchecker.sh
- uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
- uses: actions/setup-node@v6.3.0
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: ./tgui/yarn.lock
- run: pip install -r tools/requirements.txt
- name: Run Linters
run: |
tools/ci/check_json.sh
tgui/bin/tgui --ci
python tools/ci/check_grep2.py
python tools/ci/check_line_endings.py
python tools/ci/check_file_names.py
python tools/ci/unticked_files.py ${GITHUB_WORKSPACE}
python tools/ci/illegal_dme_files.py ${GITHUB_WORKSPACE}
python tools/ci/define_sanity.py
python tools/ci/identical_variables.py
python tools/ci/restrict_file_types.py
python tools/ci/verify_sql_version.py
python tools/ci/no_duplicate_definitions.py
python tools/ci/check_icons.py
python tools/ci/check_random_spawner_prefabs.py
python -m tools.ci.check_map_sizes
python -m tools.ci.check_legacy_attack_chain
python -m tools.ci.check_simplemob_additions
python -m tools.ci.check_user_verb_params
python -m tools.maplint.source --github
- name: Run DreamChecker
shell: bash
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
odlint:
name: Lint with OpenDream
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Setup OD
run: |
bash tools/ci/setup_od.sh
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 9.x
- name: Run OD
run: |
bash tools/ci/run_od.sh
compile_all_maps:
name: Compile All Maps
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
byondtype: ['STABLE']
steps:
- uses: actions/checkout@v6
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
release: ${{ matrix.byondtype }}
# We test PARADISE_PRODUCTION_HARDWARE here because we dont in station_mapload_tests
- name: Compile All Maps
run: |
tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/ci/generate_maplist.sh
DreamMaker -DMULTIINSTANCE -DCIMAP -DPARADISE_PRODUCTION_HARDWARE paradise.dme
docker_build:
name: Build (Docker)
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v6
- name: Load Build Dependencies
id: deps
shell: bash
run: |
set -euo pipefail
source ./_build_dependencies.sh
# export as step outputs
{
echo "NODE_VERSION=$NODE_VERSION"
echo "RUST_VERSION=$RUST_VERSION"
echo "STABLE_BYOND_MAJOR=$STABLE_BYOND_MAJOR"
echo "STABLE_BYOND_MINOR=$STABLE_BYOND_MINOR"
# metadata for provenance
echo "VCS_REF=${GITHUB_SHA}"
echo "BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
} >> "$GITHUB_OUTPUT"
- name: Generate Docker Metadata
id: docker_meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/paradisess13/paradise
tags: |
# branch event
type=ref,event=branch
# pull request event
type=ref,event=pr
# full length sha
type=sha,format=long
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Push Docker Image
uses: docker/build-push-action@v7
with:
context: .
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
NODE_VERSION=${{ steps.deps.outputs.NODE_VERSION }}
RUST_VERSION=${{ steps.deps.outputs.RUST_VERSION }}
STABLE_BYOND_MAJOR=${{ steps.deps.outputs.STABLE_BYOND_MAJOR }}
STABLE_BYOND_MINOR=${{ steps.deps.outputs.STABLE_BYOND_MINOR }}
VCS_REF=${{ steps.deps.outputs.VCS_REF }}
BUILD_DATE=${{ steps.deps.outputs.BUILD_DATE }}
cache-from: type=gha
cache-to: type=gha,mode=max
station_mapload_tests:
name: Station Tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Let all map tests run to completion
matrix:
station: ['boxstation', 'deltastation', 'metastation', 'cerestation', 'emeraldstation']
byondtype: ['STABLE']
steps:
- uses: actions/checkout@v6
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
release: ${{ matrix.byondtype }}
- name: Compile & Run Unit Tests
run: |
tools/ci/install_byond.sh '${{ matrix.byondtype }}'
source $HOME/BYOND/byond/bin/byondsetup
DreamMaker -DMAP_TESTS -DTEST_CONFIG_OVERRIDE=\"unit_tests\" -DMULTIINSTANCE -DCIBUILDING paradise.dme
mkdir -p data
echo '/datum/map/${{ matrix.station }}' > data/next_map.txt
tools/ci/run_server.sh
unit_tests_and_sql:
name: Unit Tests + SQL Validation
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
byondtype: ['STABLE']
steps:
- uses: actions/checkout@v6
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
release: ${{ matrix.byondtype }}
- name: Setup & Validate DB
run: |
sudo systemctl start mysql
python3 tools/ci/generate_sql_scripts.py
tools/ci/validate_sql.sh
- name: Compile & Run Unit Tests
run: |
tools/ci/install_byond.sh '${{ matrix.byondtype }}'
source $HOME/BYOND/byond/bin/byondsetup
DreamMaker -DGAME_TESTS -DTEST_CONFIG_OVERRIDE=\"unit_tests\" -DMULTIINSTANCE -DCIBUILDING paradise.dme
mkdir -p data
echo '/datum/map/test_tiny' > data/next_map.txt
tools/ci/run_server.sh