-
-
Notifications
You must be signed in to change notification settings - Fork 6
139 lines (130 loc) Β· 4.62 KB
/
Copy pathci.yml
File metadata and controls
139 lines (130 loc) Β· 4.62 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
name: CI
on:
pull_request:
push:
branches: [master]
# Cancel an in-progress run when a newer commit is pushed to the same ref
# (PR or branch), so we don't burn CI minutes on superseded commits.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
# Disable HTTP/2 multiplexing for crates.io downloads. curl's HTTP/2
# against the GitHub-hosted runner network intermittently fails with
# "[16] Error in the HTTP2 framing layer", aborting dependency fetches
# (e.g. moxcms via image). Forcing HTTP/1.1 makes registry fetches
# reliable at a negligible throughput cost.
CARGO_HTTP_MULTIPLEXING: "false"
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install fontconfig (native font enumeration via fontique)
run: |
sudo apt-get update
sudo apt-get install -y libfontconfig1-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --workspace --all-targets --exclude darkly-wasm --features darkly/testing -- -D warnings
clippy-wasm:
name: clippy (wasm32)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: wasm32-unknown-unknown
- run: cargo clippy -p darkly-wasm --target wasm32-unknown-unknown --all-targets -- -D warnings
test:
name: cargo test + coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Mesa Vulkan software renderer (lavapipe) + fontconfig
run: |
sudo apt-get update
sudo apt-get install -y mesa-vulkan-drivers vulkan-tools libvulkan1 libfontconfig1-dev
vulkaninfo --summary || true
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: cargo llvm-cov
env:
WGPU_BACKEND: vulkan
run: cargo llvm-cov --workspace --exclude darkly-wasm --features darkly/testing --lcov --output-path lcov.info -- --test-threads=1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
# Coverage upload is best-effort: tests are the gate, and we
# don't want a Codecov-side outage to redden a PR whose tests
# pass. The GPG signature check on Codecov's CLI binary stays
# ON β when their keyserver fails to serve the public key the
# upload step aborts before running the unverified binary
# (which has access to CODECOV_TOKEN and the repo), and CI
# surfaces it as a job-level warning instead of a failure.
fail_ci_if_error: false
flags: rust
wasm-build:
name: wasm-pack build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: latest
- name: wasm-pack build (release)
working-directory: frontend/wasm
run: wasm-pack build --release --target web --out-dir pkg
frontend:
name: frontend typecheck + build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: latest
- name: npm ci
working-directory: frontend
run: npm ci
- name: wasm:build
working-directory: frontend
# Run before vitest so test files that transitively import the
# config store (which loads `wasm/pkg/darkly_wasm`) can resolve.
# `npm run build` would also rebuild the pkg, but doing it once
# explicitly here keeps the test step independent.
run: npm run wasm:build
- name: vitest
working-directory: frontend
run: npm test
- name: vite build (includes svelte-check via tsc)
working-directory: frontend
run: npm run build