| 1 | name: Rustfmt and clippy check |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | types: [opened, synchronize, reopened] |
| 6 | push: |
| 7 | branches: |
| 8 | - main |
| 9 | |
| 10 | jobs: |
| 11 | rustfmt_clippy: |
| 12 | strategy: |
| 13 | fail-fast: true |
| 14 | |
| 15 | name: Rustfmt and clippy check |
| 16 | runs-on: ubuntu-latest |
| 17 | |
| 18 | steps: |
| 19 | - uses: actions/checkout@v3 |
| 20 | |
| 21 | - name: Install Rust Nightly |
| 22 | run: | |
| 23 | rustup override set nightly |
| 24 | rustup update nightly |
| 25 | rustup component add rustfmt clippy |
| 26 | |
| 27 | - name: rustfmt |
| 28 | run: cargo fmt --all -- --check |
| 29 | |
| 30 | - name: clippy |
| 31 | run: cargo clippy |