Skip to content

Commit

Permalink
Add support for using sccache
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jan 20, 2025
1 parent 7bfefdf commit 2aeb3e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/[email protected]
if: inputs.use-sccache == 'true' && steps.rust-cache.outputs.cache-hit == 'true'

- name: Run tests (*nix)
working-directory: ${{ inputs.working-directory }}
shell: bash
Expand Down

0 comments on commit 2aeb3e4

Please sign in to comment.