-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (54 loc) · 1.59 KB
/
Copy pathci.yml
File metadata and controls
59 lines (54 loc) · 1.59 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
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --locked
- run: cargo test --locked
- run: cargo clippy --locked --all-targets --all-features -- -D warnings
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
viewer-ui:
name: Viewer frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: viewer-ui/package-lock.json
- run: npm ci
working-directory: viewer-ui
- run: npm run build
working-directory: viewer-ui
# dist/ is committed so `cargo install` needs no Node. If a rebuild here
# differs, the checked-in bundle is stale and the binary would ship a
# frontend that does not match the source.
- name: Check the committed bundle is up to date
run: |
if ! git diff --quiet -- viewer-ui/dist; then
echo "viewer-ui/dist is stale — run 'npm --prefix viewer-ui run build' and commit"
git diff --stat -- viewer-ui/dist
exit 1
fi