Merge pull request #1 from carougen/intro_to_math_crypto #4
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
name: Format & Lint | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
format-and-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain + components | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache target directory | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Lint with Clippy | |
run: cargo clippy --all -- -D warnings |