-
-
Notifications
You must be signed in to change notification settings - Fork 186
294 lines (247 loc) · 8.13 KB
/
ci.yml
File metadata and controls
294 lines (247 loc) · 8.13 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main, "release/**"]
permissions:
contents: read
actions: read
checks: write
pull-requests: write
id-token: write
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
go-tests:
name: Go Tests (${{ matrix.module.name }})
runs-on: depot-ubuntu-24.04-32
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
module:
- name: backend
path: backend
timeout: 30
gcc: true
cgo_enabled: "1"
- name: cli
path: cli
timeout: 10
gcc: false
cgo_enabled: "1"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Just
uses: extractions/setup-just@v3
- name: Set up Depot CLI
if: matrix.module.gcc
uses: depot/setup-action@v1
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.module.path }}/go.mod
cache: true
cache-dependency-path: ${{ matrix.module.path }}/go.sum
- name: Install GCC
if: matrix.module.gcc
run: |
sudo apt-get update
sudo apt-get install -y gcc
- name: Download modules
run: just deps install go
- name: Run unit tests
env:
CGO_ENABLED: ${{ matrix.module.cgo_enabled }}
run: just test ${{ matrix.module.name }}
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.module.name }}-coverage
path: ${{ matrix.module.path }}/coverage.txt
go-linter:
name: Go Linter (${{ matrix.module.name }})
runs-on: depot-ubuntu-24.04-16
strategy:
fail-fast: false
matrix:
module:
- name: backend
args: --build-tags=exclude_frontend --config=../.github/.golangci.yml
- name: cli
args: --config=../.github/.golangci.yml
- name: types
args: --config=../.github/.golangci.yml
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.module.name }}/go.mod
cache-dependency-path: ${{ matrix.module.name }}/go.sum
- name: Run Golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
args: ${{ matrix.module.args }}
working-directory: ${{ matrix.module.name }}
only-new-issues: false
deadcode:
name: Go Deadcode Analysis
if: github.event.pull_request.head.repo.owner.login == 'getarcaneapp'
runs-on: depot-ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- name: Install deadcode
run: go install golang.org/x/tools/cmd/deadcode@latest
- name: Add deadcode problem matcher
run: echo "::add-matcher::.github/matchers/deadcode-matcher.json"
- name: Run deadcode analysis
id: deadcode
working-directory: backend
continue-on-error: true
run: |
OUTPUT=$(deadcode ./... 2>&1 || true)
echo "$OUTPUT"
COUNT=$(echo "$OUTPUT" | grep -c "unreachable func" || true)
if [ -z "$COUNT" ]; then COUNT=0; fi
echo "count=$COUNT" >> $GITHUB_OUTPUT
echo "output<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@v4
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "## 🔍 Deadcode Analysis"
- name: Delete comment if no deadcode found
if: steps.deadcode.outputs.count == '0' && steps.fc.outputs.comment-id != ''
uses: actions/github-script@v8
with:
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ steps.fc.outputs.comment-id }}
})
- name: Comment deadcode results
if: steps.deadcode.outputs.count != '0'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## 🔍 Deadcode Analysis
Found **${{ steps.deadcode.outputs.count }}** unreachable functions in the backend.
<details>
<summary>View details</summary>
```
${{ steps.deadcode.outputs.output }}
```
Only remove deadcode that you know is 100% no longer used.
</details>
> Analysis from commit ${{ github.sha }}
edit-mode: replace
svelte-check:
name: Svelte Type Check
runs-on: depot-ubuntu-24.04-8
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 25
cache: pnpm
- name: Setup Just
uses: extractions/setup-just@v3
- name: Install Fontend Dependencies
run: just deps install frontend
- name: Add svelte-check problem matcher
run: echo "::add-matcher::.github/matchers/svelte-check-matcher.json"
- name: Build frontend
run: just build single frontend
- name: Run svelte-check
run: just lint frontend
e2e-tests:
name: E2E Tests (${{ matrix.database.name }})
if: ${{ github.head_ref != 'l10n_crowdin' }}
runs-on: depot-ubuntu-24.04-32
permissions:
contents: read
actions: write
id-token: write
strategy:
fail-fast: false
matrix:
database:
- name: sqlite
compose_file: setup/compose.yaml
port: 3000
- name: postgres
compose_file: setup/compose-postgres.yaml
port: 3001
- name: proxy
compose_file: setup/compose-proxy.yaml
port: 3002
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Just
uses: extractions/setup-just@v3
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 25
cache: pnpm
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Setup depot buildx driver
run: depot configure-docker
- name: Cache Playwright Browsers
uses: actions/cache@v5
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('tests/pnpm-lock.yaml', 'tests/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Pull and save test images
run: |
docker pull ghcr.io/linuxserver/nginx:latest
docker pull ghcr.io/linuxserver/radarr:nightly
docker save ghcr.io/linuxserver/nginx:latest ghcr.io/linuxserver/radarr:nightly > /tmp/test-images.tar
- name: Setup and Install Playwright Dependencies
run: just deps install tests
- name: Run Playwright E2E tests
run: just test e2e
env:
COMPOSE_FILE: ${{ matrix.database.compose_file }}
BASE_URL: http://localhost:${{ matrix.database.port }}
- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report-${{ matrix.database.name }}
path: tests/.report
include-hidden-files: true
retention-days: 15