| 1 | on: |
| 2 | push: |
| 3 | branches: [master] |
| 4 | pull_request: |
| 5 | |
| 6 | name: Build, Test |
| 7 | |
| 8 | jobs: |
| 9 | build-test: |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - uses: actions/checkout@v2 |
| 13 | - uses: actions-rs/toolchain@v1 |
| 14 | with: |
| 15 | toolchain: stable |
| 16 | profile: minimal |
| 17 | components: rustfmt, clippy |
| 18 | - name: Build |
| 19 | uses: actions-rs/cargo@v1 |
| 20 | with: |
| 21 | command: build |
| 22 | - name: Run tests |
| 23 | uses: actions-rs/cargo@v1 |
| 24 | with: |
| 25 | command: test |
| 26 | - name: Check formatting |
| 27 | uses: actions-rs/cargo@v1 |
| 28 | with: |
| 29 | command: fmt |
| 30 | args: -- --check |
| 31 | - name: Catch common mistakes |
| 32 | uses: actions-rs/cargo@v1 |
| 33 | with: |
| 34 | command: clippy |
| 35 | args: --all-targets -- -D warnings |