Rewrite workflow #6
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
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
- radrow/gh-65 | ||
name: Rustfmt Check | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Cache Cargo registry | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-registry- | ||
- name: Cache Cargo build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/bin | ||
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-bin- | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
toolchain: nightly | ||
- name: Run rustfmt | ||
run: cargo fmt --all -- --check | ||
- name: Complete Check | ||
if: failure() | ||
run: echo "Bad formatting. Please run `cargo fmt`" |