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