lints.yml 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. on:
  2. push:
  3. branches:
  4. - main
  5. paths:
  6. - '**.rs'
  7. workflow_dispatch:
  8. pull_request:
  9. paths:
  10. - '**.rs'
  11. name: Lints
  12. jobs:
  13. rustfmt:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - uses: actions/checkout@v2
  17. - name: Install stable toolchain
  18. uses: actions-rs/toolchain@v1
  19. with:
  20. profile: minimal
  21. toolchain: stable
  22. override: true
  23. components: rustfmt
  24. - name: Run cargo fmt
  25. uses: actions-rs/cargo@v1
  26. with:
  27. command: fmt
  28. args: --all -- --check
  29. clippy_check:
  30. name: Clippy check
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. - name: Install stable toolchain
  35. uses: actions-rs/toolchain@v1
  36. with:
  37. toolchain: stable
  38. components: clippy
  39. override: true
  40. - uses: actions-rs/clippy-check@v1
  41. with:
  42. token: ${{ secrets.GITHUB_TOKEN }}