From 60927c1c727941d0aea73bdc1a33132d92ce7956 Mon Sep 17 00:00:00 2001 From: strawberry Date: Wed, 24 Jul 2024 22:22:45 -0400 Subject: [PATCH] ci: try using sccache Signed-off-by: strawberry --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ flake.nix | 2 ++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a30fb061..d95147ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,16 @@ concurrency: cancel-in-progress: true env: + # sccache + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + SCCACHE_BUCKET: "sccache" + SCCACHE_S3_USE_SSL: ${{ vars.SCCACHE_S3_USE_SSL }} + SCCACHE_REGION: ${{ vars.SCCACHE_REGION }} + SCCACHE_ENDPOINT: ${{ vars.SCCACHE_ENDPOINT }} + SCCACHE_CACHE_MULTIARCH: ${{ vars.SCCACHE_CACHE_MULTIARCH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # Required to make some things output color TERM: ansi # Publishing to my nix binary cache @@ -126,6 +136,11 @@ jobs: run: | bin/nix-build-and-cache ci + # use sccache for Rust + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@main + + # use rust-cache - uses: Swatinem/rust-cache@v2 - name: Run CI tests @@ -244,6 +259,13 @@ jobs: direnv allow nix develop .#all-features --command true + # use sccache for Rust + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@main + + # use rust-cache + - uses: Swatinem/rust-cache@v2 + - name: Build static ${{ matrix.target }} run: | CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*') diff --git a/flake.nix b/flake.nix index 225aef09..e480fd82 100644 --- a/flake.nix +++ b/flake.nix @@ -136,6 +136,8 @@ # Useful for editing the book locally mdbook + + sccache ]) ++ scope.main.buildInputs ++ scope.main.propagatedBuildInputs