name: Rust
on:
push:
branches: [ main ]
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- name: rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test:
runs-on: ubuntu-latest
strategy:
matrix:
default: ["", "--no-default-features"]
features: ["''", "derive", "parsing", "printing", "clone-impls", "proc-macro", "visit", "visit-mut", "fold", "extra-traits", "full"]
steps:
- uses: actions/checkout@v2
- name: run check
uses: actions-rs/cargo@v1
with:
command: check
args: ${{ matrix.default }} --features ${{ matrix.features }} --verbose
- name: run test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.default }} --features ${{ matrix.features }} --verbose
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ matrix.default }} --features ${{ matrix.features }} -- -Dwarnings