Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ inputs:
description: "Shared key for caching across jobs"
required: false
default: "shared" # To allow reuse across jobs
timestamp:
description: "Timestamp cache with cargo sweep"

outputs:
deps-cache-hit:
description: "True if the dependencies were cached, false otherwise"
value: ${{ steps.rust-dep-cache.outputs.cache-hit }}

runs:
using: "composite"
Expand All @@ -37,6 +44,7 @@ runs:
targets: ${{ inputs.targets }}

- name: Rust Dependency Cache
id: rust-dep-cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'develop' }}
Expand All @@ -52,3 +60,13 @@ runs:
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
${{ inputs.sccache == 'true' && 'echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV' || '' }}
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV

- name: Install Sweep
shell: bash
if: ${{ inputs.timestamp == 'true' && github.ref_name == 'develop' }}
run: cargo install cargo-sweep

- name: Timestamp Cache
shell: bash
if: ${{ inputs.timestamp == 'true' && github.ref_name == 'develop' }}
run: cargo sweep --stamp