reusable-test.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. name: Reusable - Test
  2. on:
  3. workflow_call:
  4. inputs:
  5. cache-read-only:
  6. type: boolean
  7. required: false
  8. no-build-cache:
  9. type: boolean
  10. required: false
  11. secrets:
  12. GRADLE_ENTERPRISE_ACCESS_KEY:
  13. required: false
  14. GE_CACHE_USERNAME:
  15. required: false
  16. GE_CACHE_PASSWORD:
  17. required: false
  18. jobs:
  19. test:
  20. runs-on: ubuntu-latest
  21. strategy:
  22. matrix:
  23. test-java-version:
  24. - 8
  25. - 11
  26. - 17
  27. - 18
  28. vm:
  29. - hotspot
  30. - openj9
  31. fail-fast: false
  32. steps:
  33. - uses: actions/checkout@v3
  34. - id: setup-test-java
  35. name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
  36. uses: actions/setup-java@v3
  37. with:
  38. distribution: ${{ matrix.vm == 'hotspot' && 'temurin' || 'adopt-openj9'}}
  39. java-version: ${{ matrix.test-java-version }}
  40. - name: Set up JDK for running Gradle
  41. uses: actions/setup-java@v3
  42. with:
  43. distribution: temurin
  44. java-version: 17
  45. # vaadin tests use pnpm
  46. - name: Cache pnpm modules
  47. uses: actions/cache@v3
  48. with:
  49. path: ~/.pnpm-store
  50. key: ${{ runner.os }}-test-cache-pnpm-modules
  51. - name: Start deadlock detector
  52. run: .github/scripts/deadlock-detector.sh
  53. - name: Test
  54. env:
  55. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  56. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  57. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  58. uses: gradle/gradle-build-action@v2
  59. with:
  60. arguments: check -PtestJavaVersion=${{ matrix.test-java-version }} -PtestJavaVM=${{ matrix.vm }} -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
  61. # only push cache for one matrix option since github action cache space is limited
  62. cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }}
  63. # gradle enterprise is used for the build cache
  64. gradle-home-cache-excludes: caches/build-cache-1
  65. - name: Upload deadlock detector artifacts if any
  66. if: always()
  67. uses: actions/upload-artifact@v3
  68. with:
  69. name: deadlock-detector-test-${{ matrix.test-java-version }}-${{ matrix.vm }}
  70. path: /tmp/deadlock-detector-*
  71. if-no-files-found: ignore
  72. - name: Upload jvm crash dump files if any
  73. if: always()
  74. uses: actions/upload-artifact@v3
  75. with:
  76. name: javacore-test-${{ matrix.test-java-version }}
  77. path: |
  78. **/hs_err_pid*.log
  79. **/javacore.*.txt
  80. **/Snap.*.trc
  81. **/core.*.dmp
  82. **/jitdump.*.dmp
  83. if-no-files-found: ignore