Repository navigation
61 lines (61 loc) · 2.21 KB
/
Copy pathcheck.yml
File metadata and controls
61 lines (61 loc) · 2.21 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
# What `just check` runs, on every push and pull request, except the style guide screenshots (`test:ui`):
# their reference images come from the lead's machine, and a CI runner's fonts render them differently.
# It also builds the site as a deploy does, with no API to reach, so a page that reads the API while being
# prerendered fails here instead of in `just deploy`. Not in `just check`: it writes the `.next/` that
# `next dev` is using.
name: Check
on:
push:
pull_request:
permissions:
contents: read
jobs:
api:
runs-on: ubuntu-24.04
services:
# The tests make a database of their own per test (`sqlx::test`); queries are checked against this one.
postgres:
image: postgres:18
env:
POSTGRES_USER: sourcejump
POSTGRES_PASSWORD: ci-only
POSTGRES_DB: sourcejump
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
env:
DATABASE_URL: postgres://sourcejump:ci-only@localhost:5432/sourcejump
defaults:
run:
working-directory: api
steps:
- uses: actions/checkout@v7
- run: scripts/doc-budget.sh
working-directory: .
- run: rustup toolchain install
- run: cargo install sqlx-cli@0.9.0 --locked --no-default-features --features postgres
- run: sqlx migrate run --source crates/api/migrations
- run: cargo fmt --check
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo test --locked
# As `just check`: the query cache covers every query outside tests, so the API builds without a database.
- run: SQLX_OFFLINE=true cargo check --locked --workspace
web:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
cache-dependency-path: web/package-lock.json
- run: npm ci
- run: npm run --silent format:check
- run: npm run --silent lint
- run: npm run --silent typecheck
- run: npm run --silent api:check
- run: npm run --silent test
- run: npm run --silent build