This repository was archived by the owner on May 22, 2024. It is now read-only.
Fix/template cache bug (#27) #27
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
# See https://stackoverflow.com/questions/75951150/why-cant-my-cache-action-triggered-inside-a-pull-request-not-access-the-cache-t | |
name: Post Merge Cache Building on Main Branch | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
id: rust-cache | |
- name: Check for cache hit | |
run: echo "cache-hit=${{ steps.rust-cache.outputs.cache-hit }}" | |
- if: ${{ steps.rust-cache.outputs.cache-hit == 'false' }} | |
run: cargo fmt --check | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
id: rust-cache | |
- name: Check for cache hit | |
run: echo "cache-hit=${{ steps.rust-cache.outputs.cache-hit }}" | |
- if: ${{ steps.rust-cache.outputs.cache-hit == 'false' }} | |
run: cargo check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
id: rust-cache | |
- name: Check for cache hit | |
run: echo "cache-hit=${{ steps.rust-cache.outputs.cache-hit }}" | |
- if: ${{ steps.rust-cache.outputs.cache-hit == 'false' }} | |
run: cargo clippy | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
id: rust-cache | |
- name: Check for cache hit | |
run: echo "cache-hit=${{ steps.rust-cache.outputs.cache-hit }}" | |
- name: Install latest nextest release | |
uses: taiki-e/install-action@nextest | |
- if: ${{ steps.rust-cache.outputs.cache-hit == 'false' }} | |
run: cargo nextest run --all-features |