Files
Georgios Jason Efstathiou 2ffcf1b95a ryph: warm the cargo build in image builds only
At run time the warm steps rebuilt the crates with build scripts on
every start, which took about two minutes. Cargo now builds only what a
command needs, when it runs.
2026-10-08 13:04:16 +02:00

27 lines
1.8 KiB
YAML

steps:
# An image layer keeps whole-second mtimes, but cargo fingerprints the
# nanoseconds it saw at build time. Rounding tracked files down to the
# second before building keeps the warm target/ fresh at run time. Never
# set them to the commit time: on an incremental image build that can make
# a changed file older than its stale build output.
- name: round source mtimes down to whole seconds (image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || git ls-files -z | xargs -0 perl -e ''for (@ARGV) { next if -l; my $m = (lstat)[9]; utime $m, $m, $_ }'''
- name: install npm dependencies
run: npm install --prefer-offline
- name: install Playwright WebKit
run: npx playwright install webkit
- name: install the pinned Radicle binaries for e2e tests
run: scripts/install-binaries
# The cargo warm steps only fill the image's target/. At run time cargo
# builds what a command needs when it runs.
- name: warm clippy (scripts/check-rs, image builds only)
run: 'mkdir -p build && { [ "$RYPH_SETUP_PHASE" != image ] || cargo clippy --workspace --all-targets --locked; }'
- name: warm cargo test (scripts/check-rs, image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || cargo test --workspace --no-run --locked'
- name: warm the e2e backend (tests/support/globalSetup.ts, image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || { cargo build --manifest-path ./crates/test-http-api/Cargo.toml --locked && cargo build -p radicle-job --bin rad-job --locked; }'
# rustc's incremental cache only speeds up rebuilding this repo's own
# crates after an edit, and it is gigabytes. Image builds only.
- name: drop the incremental cache (image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || rm -rf target/debug/incremental'