ci: go back to using default cache key + target, update to 2.2.1 (#1058)

* ci: go back to using default cache key + target, update to 2.2.1

* fix formatting
This commit is contained in:
Clement Tsang 2023-03-13 01:01:23 -04:00 committed by GitHub
parent 7f4e762921
commit 4f1ac8255f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -97,10 +97,10 @@ jobs:
target: ${{ matrix.info.target }} target: ${{ matrix.info.target }}
- name: Enable Rust cache - name: Enable Rust cache
uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # 2.2.0 uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # 2.2.1
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with: with:
shared-key: build-cache-${{ matrix.info.target }} key: ${{ matrix.info.target }}
- name: Check cargo fmt - name: Check cargo fmt
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
@ -241,10 +241,10 @@ jobs:
target: ${{ matrix.info.target }} target: ${{ matrix.info.target }}
- name: Enable Rust cache - name: Enable Rust cache
uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # 2.2.0 uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # 2.2.1
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with: with:
shared-key: build-cache-${{ matrix.info.target }} key: ${{ matrix.info.target }}
- name: Check - name: Check
uses: ClementTsang/cargo-action@v0.0.3 uses: ClementTsang/cargo-action@v0.0.3

View File

@ -43,9 +43,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
info: info:
- { os: "ubuntu-latest" } - { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu" }
- { os: "macos-12" } - { os: "macos-12", target: "x86_64-apple-darwin" }
- { os: "windows-2019" } - { os: "windows-2019", target: "x86_64-pc-windows-msvc" }
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -56,8 +56,10 @@ jobs:
toolchain: stable toolchain: stable
- name: Enable Rust cache - name: Enable Rust cache
uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # 2.2.0 uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # 2.2.1
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with:
key: ${{ matrix.info.target }}
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
run: | run: |
@ -66,7 +68,7 @@ jobs:
- name: Generate code coverage - name: Generate code coverage
run: | run: |
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked --target=${{ matrix.info.target }}
- name: Upload to codecov.io - name: Upload to codecov.io
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # 3.1.1 uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # 3.1.1