name: Build & Test
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: test
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install correct toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Run tests
run: TERM=linux cargo test --verbose
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: Check formatting
run: |
cargo fmt --all --check