build-pull-request.yml 2.9 KB

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