Obey clippy #156
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Quality | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profiles: minimal | |
| override: true | |
| components: rustfmt,clippy | |
| - name: Validate cargo format | |
| run: cargo fmt -- --check | |
| - name: Check workflow permissions | |
| id: check_permissions | |
| uses: scherermichael-oss/[email protected] | |
| with: | |
| required-permission: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run clippy action to produce annotations | |
| uses: actions-rs/clippy-check@v1 | |
| if: steps.check_permissions.outputs.has-permission | |
| env: | |
| RUSTFLAGS: "-C target-cpu=native" | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| args: --all | |
| - name: Run clippy manually without annotations | |
| if: ${{ !steps.check_permissions.outputs.has-permission }} | |
| env: | |
| RUSTFLAGS: "-C target-cpu=native" | |
| run: cargo clippy --all |