Delete outdated cargo cache to force save #341
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: 38 11 * * 6 | |
jobs: | |
ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache/restore@v4 | |
with: | |
key: cargo-home | |
path: | | |
~/.cargo/bin | |
~/.cargo/.crates* | |
- id: before | |
run: echo snapshot="$(cargo install --list | sha256sum)" >> $GITHUB_OUTPUT | |
- run: rustup install nightly | |
- run: rustup component add --toolchain=nightly clippy miri rustfmt | |
- run: cargo +nightly install cargo-audit --locked | |
- run: rustup install stable | |
- run: rustup install 1.48 | |
- id: after | |
run: echo snapshot="$(cargo install --list | sha256sum)" >> $GITHUB_OUTPUT | |
- if: ${{ steps.before.outputs.snapshot != steps.after.outputs.snapshot }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
ID="$(gh cache list --ref=${{ github.ref }} --key=cargo-home --json=id --jq='.[].id')" | |
[ -z "$ID" ] || gh cache delete "$ID" | |
- if: ${{ steps.before.outputs.snapshot != steps.after.outputs.snapshot }} | |
uses: actions/cache/save@v4 | |
with: | |
key: cargo-home | |
path: | | |
~/.cargo/bin | |
~/.cargo/.crates* | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup install nightly | |
- run: rustup install stable | |
- run: rustup install 1.48 | |
concurrency: | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
group: ci-${{ github.ref }} | |
permissions: | |
actions: write |