Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Fix/templated cache bug (#25) #25

Fix/templated cache bug (#25)

Fix/templated cache bug (#25) #25

Workflow file for this run

# 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