Repository navigation
245 lines (214 loc) · 9.52 KB
/
Copy pathci.yml
File metadata and controls
245 lines (214 loc) · 9.52 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '17 5 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
changes:
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: read
outputs:
rust: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.rust == 'true' }}
renderer: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.renderer == 'true' || steps.filter.outputs.js == 'true' }}
tooling: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.tooling == 'true' || steps.filter.outputs.js == 'true' }}
site: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.site == 'true' || steps.filter.outputs.js == 'true' }}
index: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.index == 'true' || steps.filter.outputs.js == 'true' }}
licenses: ${{ steps.full.outputs.full == 'true' || steps.filter.outputs.licenses == 'true' || steps.filter.outputs.js == 'true' }}
steps:
- uses: actions/checkout@v7
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d
if: github.event_name == 'push' || github.event_name == 'pull_request'
id: filter
with:
base: ${{ github.event_name == 'push' && github.event.before || '' }}
ref: ${{ github.event_name == 'push' && github.sha || '' }}
predicate-quantifier: some-with-excludes
filters: .github/path-filters.yml
- id: full
env:
FULL: ${{ (github.event_name != 'push' && github.event_name != 'pull_request') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files >= 3000) || steps.filter.outputs.workflow == 'true' }}
run: echo "full=$FULL" >> "$GITHUB_OUTPUT"
checks:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: bun run check-version
- run: bun run check-overrides
- run: bun run check-commands
- run: bun run check-csp
- run: bun run check-updater
- run: bun run check-i18n
- run: bun run check-changes
- name: i18n read-only check
run: bun run i18n:check-readonly
- run: bun run format:check
- run: bun run lint
- run: bun run typecheck
rust-linux:
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
- run: rustup install --no-self-update
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
with:
workspaces: apps/desktop/src-tauri
shared-key: ci-ubuntu-24.04-v1
cache-bin: false
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- run: cargo clippy --locked --workspace --all-targets -- -D warnings
working-directory: apps/desktop/src-tauri
- run: cargo check --locked --release --workspace --lib --bins
working-directory: apps/desktop/src-tauri
- run: cargo test --locked --workspace
working-directory: apps/desktop/src-tauri
# The export tests regenerate these committed artifacts even on a cache hit.
- name: Fail if generated bindings are stale
run: git diff --exit-code -- apps/desktop/src/shared/bindings.ts
- name: Fail if the generated game catalogue is stale
run: git diff --exit-code -- packages/games/catalog.generated.ts
- name: Fail if the generated package reference is stale
run: git diff --exit-code -- docs/reference/game-package.md
rust-windows:
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
lane: [lint, test]
steps:
- uses: actions/checkout@v7
- name: Put Cargo home on D
shell: pwsh
run: |
$cargoHome = 'D:\cargo-home'
New-Item -ItemType Directory -Force $cargoHome | Out-Null
Copy-Item (Join-Path $env:USERPROFILE '.cargo\*') $cargoHome -Recurse -Force
"CARGO_HOME=$cargoHome" >> $env:GITHUB_ENV
"$cargoHome\bin" >> $env:GITHUB_PATH
- run: rustup install --no-self-update
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
with:
workspaces: apps/desktop/src-tauri
shared-key: ci-windows-2025-${{ matrix.lane }}-v2
cache-bin: false
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- if: matrix.lane == 'lint'
run: cargo clippy --locked --workspace --all-targets -- -D warnings
working-directory: apps/desktop/src-tauri
- if: matrix.lane == 'lint'
run: cargo check --locked --release --workspace --lib --bins
working-directory: apps/desktop/src-tauri
- if: matrix.lane == 'test'
run: cargo test --locked --workspace
working-directory: apps/desktop/src-tauri
renderer:
needs: changes
if: needs.changes.outputs.renderer == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: bun run test:renderer
- run: bun run --cwd apps/desktop test:preview
tooling:
needs: changes
if: needs.changes.outputs.tooling == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: bun run --cwd apps/desktop test:scripts
site:
needs: changes
if: needs.changes.outputs.site == 'true'
runs-on: ubuntu-24.04
steps:
# Legal dates compare each page with its version before this push. A pull
# request is checked out as a merge commit whose first parent is the base branch.
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: bun run site:check-legal-dates
env:
LEGAL_DATES_BASE: ${{ github.event_name == 'push' && github.event.before || 'HEAD^1' }}
- run: bun run site:test
- run: bun run site:build
env:
GITHUB_TOKEN: ${{ github.token }}
index:
needs: changes
if: needs.changes.outputs.index == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- name: Install pinned 7-Zip
run: bash apps/index/scripts/install-7zip.sh
- run: bun run index:test
check-licenses:
needs: changes
if: needs.changes.outputs.licenses == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: rustup install --no-self-update
- name: Cache cargo-about
id: cache-cargo-about
uses: actions/cache@v6
with:
path: ~/.cargo/bin/cargo-about
key: cargo-about-${{ runner.os }}-${{ runner.arch }}-0.9.0-v2
- name: Install cargo-about
if: steps.cache-cargo-about.outputs.cache-hit != 'true'
run: cargo install cargo-about --version 0.9.0 --locked --features=cli
- run: bun run generate-licenses
- name: Fail if desktop third-party licenses are stale
run: git diff --exit-code -- apps/desktop/THIRD_PARTY_LICENSES.md