From 3788eafa88df618f771d1b9301d0719f13eac10a Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 16:12:18 +0200 Subject: [PATCH 1/2] Speed up CI by caching rustup toolchain and using cargo-binstall Cache ~/.rustup so the toolchain isn't reinstalled every run, and install cargo-make/cargo-audit via cargo-binstall instead of compiling them from source each time. --- .forgejo/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index eb6b277..44ad576 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: path: | ~/.cargo/registry ~/.cargo/bin + ~/.rustup target key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} restore-keys: | @@ -24,13 +25,20 @@ jobs: - name: Install Rust toolchain run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt + if [ ! -x "$HOME/.cargo/bin/rustc" ]; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt + fi echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + - name: Install cargo-binstall + run: | + command -v cargo-binstall >/dev/null 2>&1 || \ + curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + - name: Install cargo-make and cargo-audit run: | for crate in cargo-make cargo-audit; do - command -v "$crate" >/dev/null 2>&1 || cargo install "$crate" + command -v "$crate" >/dev/null 2>&1 || cargo binstall -y "$crate" done - name: Run CI checks -- 2.45.2 From ff91960b7b1c9b93dc985839d4a0c35cb31f2477 Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 16:24:50 +0200 Subject: [PATCH 2/2] Force musl targets for cargo-binstall to avoid GLIBC mismatch The glibc-linked prebuilt cargo-make binary requires GLIBC 2.39, newer than what's on the node:20-bookworm image. Musl binaries are statically linked and avoid the mismatch. --- .forgejo/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 44ad576..4d101e2 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - name: Install cargo-make and cargo-audit run: | for crate in cargo-make cargo-audit; do - command -v "$crate" >/dev/null 2>&1 || cargo binstall -y "$crate" + command -v "$crate" >/dev/null 2>&1 || cargo binstall -y --targets x86_64-unknown-linux-musl "$crate" done - name: Run CI checks -- 2.45.2