name: Push Tests
on:
push:
branches:
- 'main'
pull_request:
schedule:
- cron: 0 13 * * 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-library:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.61.0
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --release
- name: Unit Tests
run: cargo test --all-features
test-examples:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: "Example CLI: Build"
run: cd examples/cli && cargo build --release
- name: "Example CLI: Test"
run: cd examples/cli && cargo test --all-features
msrv-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install cargo-msrv
run: cargo install cargo-msrv
- name: Minimum Supported Rust Version
run: cargo msrv verify
code-hygiene:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Check fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy
- name: "Example CLI: Check fmt"
run: cd examples/cli && cargo fmt --all -- --check
- name: "Example CLI: Clippy"
run: cd examples/cli && cargo clippy