lints.yml 1.0 KB

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