clippy.yml 774 B

12345678910111213141516171819202122232425
  1. on:
  2. push:
  3. branches: [ staging, trying ]
  4. pull_request_target:
  5. name: Clippy check
  6. jobs:
  7. clippy:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. checks: write
  11. steps:
  12. - uses: actions/checkout@v2
  13. if: github.event_name == 'pull_request_target'
  14. with:
  15. ref: refs/pull/${{ github.event.number }}/head
  16. - uses: actions/checkout@v2
  17. if: github.event_name != 'pull_request_target'
  18. - run: sed -n 's,^rust-version = "\(.*\)"$,RUSTUP_TOOLCHAIN=\1,p' Cargo.toml >> $GITHUB_ENV
  19. - run: rustup toolchain install $RUSTUP_TOOLCHAIN
  20. - run: rustup component add clippy
  21. - uses: actions-rs/clippy-check@v1
  22. with:
  23. token: ${{ secrets.GITHUB_TOKEN }}
  24. args: --tests --examples -- -D warnings