CI: Include Rust toolchain version in cargo cache keys to prevent cache poisoning #11587
Workflow file for this run
This file contains hidden or 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: Benchmarks | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - releases/** | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| runBenchmark: | |
| if: contains(github.event.pull_request.labels.*.name, 'run-benchmark') | |
| name: run benchmark | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| with: | |
| toolchain: stable | |
| - name: Get rust_version | |
| id: rust_version | |
| run: echo "version=$(rustc -V)" >> $GITHUB_OUTPUT | |
| - name: Cache cargo | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 | |
| with: | |
| path: | | |
| target | |
| ~/.cargo/git | |
| ~/.cargo/registry | |
| key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.rust_version.outputs.version }}-${{ hashFiles('**/Cargo.lock') }} | |
| - uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branchName: ${{ github.base_ref }} | |
| cwd: ./core/engine |