name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ "*" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: rustfmt
run: cargo fmt -- --check
- name: clippy
run: cargo clippy -- -D warnings && cargo clippy --tests -- -D warnings
- name: test
run: cargo test
- name: Check if README is up to date
run: |
cargo install cargo-readme
cargo readme > README.md
git diff --exit-code