From 2ea29b3a4f15c7578a139b977e3409fa87526fb5 Mon Sep 17 00:00:00 2001 From: Andrzej Ressel Date: Sun, 10 Mar 2024 00:14:32 +0100 Subject: [PATCH] Replace rust cache in rust-clippy.yml --- .github/workflows/build.yml | 2 ++ .github/workflows/rust-clippy.yml | 48 ++++++++++++++++--------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bc1bcc8a..fe710d40c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 + with: + prefix-key: "v0-rust-build" - uses: actions/setup-go@v5 with: go-version: '^1.22.0' diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index f1e1d802e..ca6f1c486 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -27,29 +27,31 @@ jobs: security-events: write actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: "v0-rust-clippy" - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - version: "25.3" - - name: Install required cargo - run: | - cargo install clippy-sarif || clippy-sarif --version - cargo install sarif-fmt || sarif-fmt --version - - name: Run rust-clippy - run: - cargo clippy - --all - --all-features - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt - continue-on-error: true + - name: Install Protoc + uses: arduino/setup-protoc@v3 + with: + version: "25.3" + - name: Install required cargo + run: | + cargo install clippy-sarif || clippy-sarif --version + cargo install sarif-fmt || sarif-fmt --version + - name: Run rust-clippy + run: + cargo clippy + --all + --all-features + --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + continue-on-error: true - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: rust-clippy-results.sarif - wait-for-processing: true + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: rust-clippy-results.sarif + wait-for-processing: true