Repository navigation
Commit 7a063a0
authored
ci: shorten the Windows native build critical path (ccusage#1924)
* ci: install only the Rust components the Windows build needs
rust-toolchain.toml lists clippy, rustfmt, and llvm-tools for local
development, so the first cargo call on the Windows runners downloaded six
components. Install the same channel with the minimal profile instead and pin
it through RUSTUP_TOOLCHAIN, which rustup prefers over the toolchain file. The
compiler, standard library, and target are unchanged; only the ~50 MB of xz
archives (~430 MB unpacked) the build never uses are skipped.
* ci: save the Windows Cargo cache only from main when dependencies change
Every Windows run, pull requests included, saved a fresh ~130 MB entry keyed
on the commit, and the 5-10 s post-job save sat on the critical path before
the npm job. Workspace crates recompile on every run regardless, because
checkout gives their sources fresh mtimes, so only the dependency build is
worth caching.
Key the cache on the toolchain, Cargo config, lockfile, and manifests, and
save it explicitly only on main outside pull requests when that key has no
entry yet. Pull requests now restore what main wrote and never save. The
release x64 leg restores what CI saves; arm64, which CI does not build,
remains the writer of its own cache. The single-use setup-native-build-cache
action is folded into the Windows action so restore and save share one key.
* ci: drop workspace outputs from the Windows Cargo cache before saving
Workspace crates rebuild on every run, so their rlibs, fingerprints, build
script outputs, and the final binary in rust/target/release are dead weight
that every restore has to unpack. In a local release target they are about a
quarter of its size. Remove them right before the save; dependency units keep
their fingerprints and stay fresh.1 parent 117ae68 commit 7a063a0
3 files changed
Lines changed: 67 additions & 26 deletions
File tree
- .github
- actions
- build-windows-native-package
- setup-native-build-cache
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
14 | 43 | | |
15 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
16 | 50 | | |
17 | 51 | | |
18 | 52 | | |
| 53 | + | |
| 54 | + | |
19 | 55 | | |
20 | 56 | | |
21 | 57 | | |
| |||
40 | 76 | | |
41 | 77 | | |
42 | 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 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| |||
0 commit comments