-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (113 loc) · 4.65 KB
/
Copy pathci.yml
File metadata and controls
136 lines (113 loc) · 4.65 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
name: ci
on:
pull_request:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
ci:
name: fmt / clippy / test / deny (${{ matrix.os }})
# Linux is the primary target; Windows is exercised too so the
# platform-specific paths (data dir -> %APPDATA%, browser launch, the
# device-name guard) keep compiling and the tests keep passing there.
# The default feature set is used (no `desktop`/Tauri), so Windows needs
# no WebView2; just the MSVC toolchain the runner already ships.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
# Formatting is host-independent; run it once, on Linux. The regtest
# harness is a separate workspace (see regtest-harness/README.md), so it
# gets its own fmt pass; its compile/clippy/test runs live in the
# Regtest E2E workflow, which triggers on the paths that affect it.
- name: cargo fmt
if: runner.os == 'Linux'
run: |
cargo fmt --all --check
cargo fmt --all --check --manifest-path regtest-harness/Cargo.toml
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace
# cargo-deny inspects the dependency graph (licenses / advisories /
# bans), which is host-independent; run it once, on Linux.
- name: install cargo-deny
if: runner.os == 'Linux'
uses: taiki-e/install-action@v2
with:
tool: cargo-deny
- name: cargo deny
if: runner.os == 'Linux'
run: cargo deny --all-features check
gui-typecheck:
name: gui typecheck (tsc)
runs-on: ubuntu-latest
# First Node in CI, isolated to its own job so the Rust `ci` job above
# stays Node-free (and `cargo build` never needs Node). esbuild only
# strips types, so this job is what actually type-checks the web UI.
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
cache-dependency-path: crates/zkv/src/gui/assets/package-lock.json
- name: install
working-directory: crates/zkv/src/gui/assets
run: npm ci
- name: typecheck
working-directory: crates/zkv/src/gui/assets
run: npm run typecheck
# Guard the include_bytes! pipeline: the binary embeds the committed
# generated JS, so prove it still matches the sources. Regenerate and
# fail if anything drifted (i.e. someone edited a source without
# re-running scripts/build-gui-assets.sh).
- name: verify committed JS is in sync
run: |
scripts/build-gui-assets.sh
git diff --exit-code -- \
crates/zkv/src/gui/assets/js \
crates/zkv/src/gui/assets/api.js \
crates/zkv/src/gui/assets/forms.js
msrv:
name: msrv (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Validates the declared `rust-version = "1.88"`. This is librustzcash's
# effective wallet-stack floor: zcash_client_backend's lightwalletd
# `tonic` (0.14.6) and zcash_proofs' `home` (0.5.12) both require 1.88, so
# any librustzcash wallet consumer needs it too. Default features (so the
# `gui`/axum path is included); `desktop`/Tauri is excluded as it needs
# system webview libs and isn't built in CI.
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --workspace --all-targets
docs:
name: docs (zkv)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# Build the `zkv` library docs and fail on any rustdoc warning (broken or
# private intra-doc links, bad doc HTML, etc.). Scoped to `zkv` (the
# facade + library); the binary-only sibling crates (faucet, oracles) are
# not part of the documented public surface. `--no-deps` keeps it to our
# own crate. The `gui` module is excluded (it's the web/desktop UI, not
# the library API): default features minus `gui`, which also drops the
# `desktop`/Tauri path that needs system webview libs.
- name: cargo doc
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps -p zkv --no-default-features --features transparent-inputs,default-subscriber,cli