name: CI
"on": [push, pull_request]
defaults:
run:
shell: bash
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.71.1
- stable
- beta
- nightly
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Build
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
with:
command: build
args: --verbose --all
- name: Test
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
with:
command: test
args: --verbose --all