build-pull-request.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. name: Build pull request
  2. on:
  3. pull_request:
  4. concurrency:
  5. group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  6. cancel-in-progress: true
  7. jobs:
  8. common:
  9. uses: ./.github/workflows/build-common.yml
  10. with:
  11. # it's rare for only the openj9 tests or the windows smoke tests to break
  12. skip-openj9-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test openj9') }}
  13. skip-windows-smoke-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test windows') }}
  14. cache-read-only: true
  15. test-latest-deps:
  16. uses: ./.github/workflows/reusable-test-latest-deps.yml
  17. with:
  18. cache-read-only: true
  19. muzzle:
  20. uses: ./.github/workflows/reusable-muzzle.yml
  21. with:
  22. cache-read-only: true
  23. shell-script-check:
  24. uses: ./.github/workflows/reusable-shell-script-check.yml
  25. # this is not a required check to avoid blocking pull requests if external links break
  26. markdown-link-check:
  27. # release branches are excluded because the README.md javaagent download link has to be updated
  28. # on release branches before the release download has been published
  29. if: "!startsWith(github.ref_name, 'release/') && !startsWith(github.base_ref, 'release/')"
  30. uses: ./.github/workflows/reusable-markdown-link-check.yml
  31. markdown-lint-check:
  32. uses: ./.github/workflows/reusable-markdown-lint-check.yml
  33. misspell-check:
  34. uses: ./.github/workflows/reusable-misspell-check.yml
  35. required-status-check:
  36. # test-latest-deps is not included in the required status checks
  37. # because any time a new library version is released to maven central
  38. # it can fail due to test code incompatibility with the new library version,
  39. # or due to slight changes in emitted telemetry
  40. # (muzzle can also fail when a new library version is released to maven central
  41. # but that happens much less often)
  42. #
  43. # only the "common" checks are required for release branch PRs in order to avoid any unnecessary
  44. # release branch maintenance (especially for patches)
  45. needs:
  46. - common
  47. - muzzle
  48. - shell-script-check
  49. - markdown-lint-check
  50. - misspell-check
  51. runs-on: ubuntu-latest
  52. if: always()
  53. steps:
  54. - if: |
  55. needs.common.result != 'success' ||
  56. (
  57. !startsWith(github.base_ref, 'release/') &&
  58. (
  59. needs.muzzle.result != 'success' ||
  60. needs.shell-script-check.result != 'success' ||
  61. needs.markdown-lint-check.result != 'success' ||
  62. needs.misspell-check.result != 'success'
  63. )
  64. )
  65. run: exit 1 # fail