|
name: CI |
|
|
|
on: |
|
push: |
|
branches: [ master ] |
|
pull_request: |
|
branches: [ master ] |
|
|
|
jobs: |
|
check: |
|
name: Check |
|
runs-on: ubuntu-latest |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
rust: |
|
- stable |
|
- beta |
|
- nightly |
|
- 1.18.0 # MSRV |
|
|
|
steps: |
|
- uses: actions/checkout@v2 |
|
name: Checkout |
|
|
|
- uses: actions-rs/toolchain@v1 |
|
with: |
|
profile: minimal |
|
toolchain: ${{ matrix.rust }} |
|
override: true |
|
name: Install Rust ${{ matrix.rust }} |
|
|
|
- uses: actions-rs/cargo@v1 |
|
with: |
|
command: check |
|
name: Run `cargo check` |
|
|
|
- uses: actions-rs/cargo@v1 |
|
with: |
|
command: check |
|
args: --examples |
|
name: Check examples |
|
if: matrix.rust != '1.18.0' |
|
|
|
test: |
|
name: Test |
|
runs-on: ubuntu-latest |
|
strategy: |
|
matrix: |
|
rust: |
|
- stable |
|
- beta |
|
- nightly |
|
steps: |
|
- uses: actions/checkout@v2 |
|
name: Checkout |
|
|
|
- uses: actions-rs/toolchain@v1 |
|
with: |
|
profile: minimal |
|
toolchain: ${{ matrix.rust }} |
|
override: true |
|
name: Install Rust ${{ matrix.rust }} |
|
|
|
- uses: actions-rs/cargo@v1 |
|
with: |
|
command: test |
|
name: Run `cargo test` |
|
|
|
lints: |
|
name: Lints |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@v2 |
|
name: Checkout |
|
|
|
- uses: actions-rs/toolchain@v1 |
|
with: |
|
profile: minimal |
|
toolchain: stable |
|
override: true |
|
components: rustfmt, clippy |
|
name: Install Rust stable |
|
|
|
- uses: actions-rs/cargo@v1 |
|
with: |
|
command: fmt |
|
args: --all -- --check |
|
name: Run `cargo fmt` |
|
|
|
- uses: actions-rs/cargo@v1 |
|
with: |
|
command: clippy |
|
args: -- -D warnings |
|
name: Run `cargo clippy` |