Formatting #27
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: build | |
on: [push] | |
jobs: | |
# Check formatting | |
fmt: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ macos-latest, ubuntu-latest, ubuntu-20.04, windows-latest ] | |
name: Rustfmt | |
runs-on: ${{ matrix.platform }} | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Rust format check. | |
run: cargo fmt --all -- --check | |
# Run basic code validity check | |
check: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ macos-latest, ubuntu-latest, ubuntu-20.04, windows-latest ] | |
needs: fmt | |
name: Check | |
runs-on: ${{ matrix.platform }} | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Rust code validity check. | |
run: cargo check | |
# Run all tests | |
test: | |
needs: check | |
name: Test Suite | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run tests. | |
run: cargo test --all-features | |
# Check code style | |
clippy: | |
needs: check | |
name: Clippy | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run clippy. | |
run: cargo clippy |