clippy.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. on:
  2. push:
  3. branches: [ main ]
  4. pull_request:
  5. merge_group:
  6. name: Lints compliance check
  7. env:
  8. CLIPPY_PARAMS: -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo
  9. jobs:
  10. clippy:
  11. strategy:
  12. matrix:
  13. toolchain: [ stable, nightly ]
  14. cargo_flags: [ --all-features, --no-default-features ]
  15. include:
  16. # Nightly is only for reference and allowed to fail
  17. - toolchain: nightly
  18. experimental: true
  19. runs-on: ubuntu-latest
  20. continue-on-error: ${{ matrix.experimental || false }}
  21. steps:
  22. - uses: actions/checkout@v3
  23. - uses: dtolnay/rust-toolchain@master
  24. with:
  25. toolchain: ${{ matrix.toolchain }}
  26. components: clippy
  27. - name: Run clippy
  28. run: cargo clippy --all ${{ matrix.cargo_flags }} -- -D warnings
  29. # Job to check that all the lint checks succeeded
  30. clippy-check:
  31. needs:
  32. - clippy
  33. runs-on: ubuntu-latest
  34. if: always()
  35. steps:
  36. - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'