From 2aeb3e493ab6c459141efe626350016b4dbdb353 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Mon, 20 Jan 2025 12:01:03 -0600 Subject: [PATCH] Add support for using sccache --- action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/action.yml b/action.yml index 2db7829..fa94a98 100644 --- a/action.yml +++ b/action.yml @@ -50,6 +50,9 @@ inputs: A JSON string containing parameters to pass to `Swatinem/rust-cache@v2`. You can use the `toJSON()` function in your action to make passing this easier. default: "{}" + use-sccache: + description: | + Use sccache. This is only allowed when `use-rust-cache` is true as well. runs: using: composite steps: @@ -158,10 +161,15 @@ runs: if: inputs.use-rust-cache == 'true' - name: Cache cargo & target directories + id: rust-cache uses: Swatinem/rust-cache@v2 with: ${{ steps.parse-rust-cache-parameters.outputs }} if: inputs.use-rust-cache == 'true' + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.7 + if: inputs.use-sccache == 'true' && steps.rust-cache.outputs.cache-hit == 'true' + - name: Run tests (*nix) working-directory: ${{ inputs.working-directory }} shell: bash