Update CI #27
Workflow file for this run
This file contains 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: Rust | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
ci: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
name: Rust Tests on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Fix cargo cache permission issue | |
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/ | |
if: matrix.os == 'ubuntu-latest' | |
- name: Cache cargo Registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo Index | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo Build | |
uses: actions/cache@v2 | |
with: | |
path: target/debug | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }} | |
- name: Check Formatting | |
run: cargo +stable fmt -- --check | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build | |
run: cargo build | |
- name: Check Clippy | |
run: cargo clippy --all-features -- -D warnings | |
if: matrix.os == 'ubuntu-latest' | |
- name: Test | |
run: cargo test |