-
Notifications
You must be signed in to change notification settings - Fork 3
284 lines (235 loc) Β· 7.72 KB
/
Copy pathchecks.yaml
File metadata and controls
284 lines (235 loc) Β· 7.72 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
name: Checks
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
frontend:
name: Check and build frontend
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install node
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Lint
run: npm run lint
working-directory: frontend
- name: Test
run: npm run test
working-directory: frontend
- name: Build
run: npm run build
working-directory: frontend
- name: Upload frontend asset folder
uses: actions/upload-artifact@v6
with:
name: frontend
path: frontend/dist
prepare-playwright:
name: Prepare playwright Tests
runs-on: ubuntu-latest
needs: frontend
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Download frontend asset folder
uses: actions/download-artifact@v7
with:
name: frontend
path: frontend/dist
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: "playwright"
- name: Build backend
run: cargo build --features apply-db-migrations --bin app
- name: Upload backend binary
uses: actions/upload-artifact@v6
with:
name: 'app'
path: target/debug/app
playwright:
name: Run Playwright Tests (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
runs-on: ubuntu-latest
continue-on-error: true
needs: prepare-playwright
strategy:
matrix:
shardIndex: [ 1, 2, 3 ]
shardTotal: [ 3 ]
services:
postgres:
image: postgres
env:
POSTGRES_USER: remails
POSTGRES_PASSWORD: remails
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Download backend binary
uses: actions/download-artifact@v7
with:
name: app
path: target/debug
- name: Download frontend asset folder
uses: actions/download-artifact@v7
with:
name: frontend
path: frontend/dist
- name: mark backend as executable
run: chmod +x target/debug/app
- name: run backend
run: NO_COLOR=true ./target/debug/app > logs-${{ matrix.shardIndex }}_of_${{ matrix.shardTotal }} &
- name: Apply some DB fixtures
run: |
psql -h localhost -U remails -w remails < src/fixtures/organizations.sql && \
psql -h localhost -U remails -w remails < src/fixtures/api_users.sql && \
psql -h localhost -U remails -w remails < src/fixtures/projects.sql && \
psql -h localhost -U remails -w remails < src/fixtures/runtime_config.sql
- uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: frontend
- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
working-directory: frontend
- name: Upload Playwright report
uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
with:
name: playwright-report-(${{ matrix.shardIndex }}_of_${{ matrix.shardTotal }})
path: frontend/playwright-report/
- name: Upload backend logs
uses: actions/upload-artifact@v6
if: always()
with:
name: backend logs (${{ matrix.shardIndex }} of ${{ matrix.shardTotal }})
path: logs-${{ matrix.shardIndex }}_of_${{ matrix.shardTotal }}
test:
name: Test
runs-on: ubuntu-latest
needs: frontend
env:
SQLX_OFFLINE: true
services:
postgres:
image: postgres
env:
POSTGRES_USER: remails
POSTGRES_PASSWORD: remails
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout sources
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
- name: Install cargo-llvm-cov & cargo-nextest
uses: taiki-e/install-action@28a9d316db64b78a951f3f8587a5d08cc97ad8eb # v2.65.6
with:
tool: cargo-llvm-cov,cargo-nextest
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: "checks"
- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"
- name: Download frontend asset folder
uses: actions/download-artifact@v7
with:
name: frontend
path: frontend/dist
- name: cargo llvm-cov nextest
run: cargo llvm-cov nextest --lcov --output-path lcov.info
env:
RUST_BACKTRACE: 1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
format:
name: Cargo fmt
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Install toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly
components: rustfmt
- name: Run rustfmt
run: |
cargo fmt --all -- --check
clippy:
name: Clippy
needs: [ frontend, format ]
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5
with:
shared-key: "checks"
- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"
- name: Download frontend asset folder
uses: actions/download-artifact@v7
with:
name: frontend
path: frontend/dist
- name: Run clippy
run: cargo clippy --no-deps --all-targets --all-features -- --deny warnings
deny:
name: Check dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918