name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: true
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting
run: cargo +nightly fmt --all -- --check
- name: Run tests without features
run: cargo +stable test -- -q
- name: Run tests with features enabled
run: cargo +stable test --features=proposals,serde -- -q
- name: Run `clippy check`
uses: giraffate/clippy-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
clippy_flags: --workspace --features=proposals,serde --all-targets -q -- -D warnings