ci: only enable ci cache if not a PR or not a fork (#872)

* ci: only enable ci cache if not a PR or not a fork

* add to coverage
This commit is contained in:
Clement Tsang 2022-11-06 02:50:45 -05:00 committed by GitHub
parent 2b3c76bf5a
commit 8c3e9669b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -12,9 +12,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Enable Rust cache
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@ba37adf8f94a7d9affce79bd3baff1b9e3189c33 # https://github.com/dtolnay/rust-toolchain/commit/ba37adf8f94a7d9affce79bd3baff1b9e3189c33
with:

View File

@ -86,6 +86,7 @@ jobs:
- name: Enable Rust cache
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
- name: Check cargo fmt
run: cargo fmt --all -- --check
@ -226,8 +227,7 @@ jobs:
- name: Enable Rust cache
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
with:
key: ${{ matrix.info.target }}
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
- name: Check
uses: ClementTsang/cargo-action@v0.0.3

View File

@ -44,6 +44,7 @@ jobs:
- name: Enable Rust cache
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
- name: Install cargo-llvm-cov
run: |