ci-pre-commit.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Pre-commit checks
  2. on:
  3. pull_request:
  4. push:
  5. branches: [main]
  6. env:
  7. PYTHON_VERSION: "3.11"
  8. POETRY_VERSION: "1.4.2"
  9. jobs:
  10. pre-commit:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. with:
  15. # Need to grab the history of the PR
  16. fetch-depth: 0
  17. - uses: actions-rs/toolchain@v1
  18. with:
  19. profile: minimal
  20. toolchain: nightly-2023-03-01
  21. components: rustfmt, clippy
  22. - uses: actions-rs/toolchain@v1
  23. with:
  24. profile: minimal
  25. toolchain: nightly-2023-07-23
  26. components: rustfmt, clippy
  27. - uses: actions-rs/toolchain@v1
  28. with:
  29. profile: minimal
  30. toolchain: nightly-2024-03-26
  31. components: rustfmt, clippy
  32. - uses: actions-rs/toolchain@v1
  33. with:
  34. profile: minimal
  35. toolchain: nightly-2024-08-04
  36. components: rustfmt, clippy
  37. - uses: actions-rs/toolchain@v1
  38. with:
  39. profile: minimal
  40. toolchain: 1.66.1
  41. components: rustfmt, clippy
  42. - uses: actions-rs/toolchain@v1
  43. with:
  44. profile: minimal
  45. toolchain: 1.73.0
  46. components: rustfmt, clippy
  47. - uses: actions-rs/toolchain@v1
  48. with:
  49. profile: minimal
  50. toolchain: 1.82.0
  51. components: rustfmt, clippy
  52. - name: Install protoc
  53. uses: arduino/setup-protoc@v3
  54. - uses: actions/checkout@v4
  55. - name: Install poetry
  56. run: pipx install poetry
  57. - uses: actions/setup-python@v2
  58. with:
  59. python-version: ${{ env.PYTHON_VERSION }}
  60. id: setup_python
  61. - name: Cache Poetry cache
  62. uses: actions/cache@v3
  63. with:
  64. path: ~/.cache/pypoetry
  65. key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
  66. - name: Install poetry dependencies
  67. run: poetry -C express_relay/sdk/python/express_relay install
  68. shell: sh
  69. - uses: pre-commit/action@v3.0.0
  70. if: ${{ github.event_name == 'pull_request' }}
  71. with:
  72. # Run only on files changed in the PR
  73. extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
  74. - uses: pre-commit/action@v3.0.0
  75. if: ${{ github.event_name != 'pull_request' }}