pr.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. name: PR
  2. on: pull_request
  3. concurrency:
  4. group: ci-${{ github.event.pull_request.number }}
  5. cancel-in-progress: true
  6. jobs:
  7. build:
  8. uses: ./.github/workflows/reusable-build.yml
  9. with:
  10. cache-read-only: true
  11. test:
  12. uses: ./.github/workflows/reusable-test.yml
  13. with:
  14. cache-read-only: true
  15. testLatestDeps:
  16. # testLatestDeps is not included in the PR workflow by default
  17. # because any time a new library version is released to maven central
  18. # it can fail due to test code incompatibility with the new library version,
  19. # or due to slight changes in emitted telemetry, which can be confusing for contributors
  20. # (muzzle can also fail when a new library version is released to maven central
  21. # but that happens much less often)
  22. #
  23. # the condition is on the steps below instead of here on the job, because skipping the job
  24. # causes the job to show up as canceled in the GitHub UI which prevents the build section from
  25. # collapsing when everything (else) is green
  26. #
  27. # and the name is updated when the steps below are skipped which makes what's happening clearer
  28. # in the GitHub UI
  29. uses: ./.github/workflows/reusable-test-latest-deps.yml
  30. with:
  31. skip: ${{ !contains(github.event.pull_request.labels.*.name, 'test latest deps') }}
  32. cache-read-only: true
  33. smoke-test:
  34. uses: ./.github/workflows/reusable-smoke-test.yml
  35. with:
  36. # windows smoke tests are slower, and it's rare for only the windows smoke tests to break
  37. skip-windows: true
  38. cache-read-only: true
  39. muzzle:
  40. # release branch PRs are excluded
  41. # because any time a new library version is released to maven central it can fail
  42. # which requires unnecessary release branch maintenance, especially for patches
  43. if: ${{ !startsWith(github.base_ref, 'v') }}
  44. uses: ./.github/workflows/reusable-muzzle.yml
  45. with:
  46. cache-read-only: true
  47. examples:
  48. uses: ./.github/workflows/reusable-examples.yml
  49. with:
  50. cache-read-only: true
  51. # markdown-link-check is not included in the PR build because links to external urls can break at
  52. # any time, which can be confusing for contributors
  53. markdown-misspell-check:
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v3
  57. - name: Check markdown for common misspellings
  58. run: |
  59. curl -L -o ./install-misspell.sh https://git.io/misspell
  60. sh ./install-misspell.sh
  61. ./bin/misspell -error ./**/*
  62. accept-pr:
  63. needs: [ build, test, smoke-test, muzzle, examples, markdown-misspell-check ]
  64. runs-on: ubuntu-latest
  65. if: always()
  66. steps:
  67. - if: |
  68. needs.build.result != 'success' ||
  69. needs.test.result != 'success' ||
  70. needs.smoke-test.result != 'success' ||
  71. needs.muzzle.result != 'success' ||
  72. needs.examples.result != 'success' ||
  73. needs.markdown-misspell-check.result != 'success'
  74. run: exit 1