build-pull-request.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. test-indy:
  20. uses: ./.github/workflows/reusable-test-indy.yml
  21. with:
  22. cache-read-only: true
  23. muzzle:
  24. uses: ./.github/workflows/reusable-muzzle.yml
  25. with:
  26. cache-read-only: true
  27. shell-script-check:
  28. uses: ./.github/workflows/reusable-shell-script-check.yml
  29. # this is not a required check to avoid blocking pull requests if external links break
  30. markdown-link-check:
  31. # release branches are excluded because the README.md javaagent download link has to be updated
  32. # on release branches before the release download has been published
  33. if: "!startsWith(github.ref_name, 'release/') && !startsWith(github.base_ref, 'release/')"
  34. uses: ./.github/workflows/reusable-markdown-link-check.yml
  35. markdown-lint-check:
  36. uses: ./.github/workflows/reusable-markdown-lint-check.yml
  37. misspell-check:
  38. uses: ./.github/workflows/reusable-misspell-check.yml
  39. required-status-check:
  40. # test-latest-deps is not included in the required status checks
  41. # because any time a new library version is released to maven central
  42. # it can fail due to test code incompatibility with the new library version,
  43. # or due to slight changes in emitted telemetry
  44. # (muzzle can also fail when a new library version is released to maven central
  45. # but that happens much less often)
  46. #
  47. # only the "common" checks are required for release branch PRs in order to avoid any unnecessary
  48. # release branch maintenance (especially for patches)
  49. needs:
  50. - common
  51. - muzzle
  52. - shell-script-check
  53. - markdown-lint-check
  54. - misspell-check
  55. runs-on: ubuntu-latest
  56. if: always()
  57. steps:
  58. - if: |
  59. needs.common.result != 'success' ||
  60. (
  61. !startsWith(github.base_ref, 'release/') &&
  62. (
  63. needs.muzzle.result != 'success' ||
  64. needs.shell-script-check.result != 'success' ||
  65. needs.markdown-lint-check.result != 'success' ||
  66. needs.misspell-check.result != 'success'
  67. )
  68. )
  69. run: exit 1 # fail