reusable-test-latest-deps.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. name: Reusable - Test latest deps
  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. permissions:
  15. contents: read
  16. jobs:
  17. test-latest-deps:
  18. name: testLatestDeps${{ matrix.test-partition }}
  19. runs-on: ubuntu-latest
  20. strategy:
  21. matrix:
  22. test-partition:
  23. - 0
  24. - 1
  25. - 2
  26. - 3
  27. fail-fast: false
  28. steps:
  29. - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
  30. - name: Free disk space
  31. run: .github/scripts/gha-free-disk-space.sh
  32. - name: Set up JDK for running Gradle
  33. uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
  34. with:
  35. distribution: temurin
  36. java-version: 21
  37. - name: Increase gradle daemon heap size
  38. run: |
  39. sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
  40. # vaadin tests use pnpm
  41. - name: Cache pnpm modules
  42. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
  43. with:
  44. path: ~/.pnpm-store
  45. key: ${{ runner.os }}-test-latest-cache-pnpm-modules
  46. - name: Start deadlock detector
  47. run: .github/scripts/deadlock-detector.sh
  48. - name: Setup Gradle
  49. uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
  50. with:
  51. cache-read-only: ${{ inputs.cache-read-only }}
  52. # gradle enterprise is used for the build cache
  53. gradle-home-cache-excludes: caches/build-cache-1
  54. - name: List tests
  55. env:
  56. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  57. run: >
  58. ./gradlew
  59. check -x spotlessCheck
  60. listTestsInPartition
  61. -PtestPartition=${{ matrix.test-partition }}
  62. -PtestLatestDeps=true
  63. - name: Set test tasks
  64. run: |
  65. echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
  66. - name: Test
  67. env:
  68. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  69. run: >
  70. ./gradlew
  71. ${{ env.test-tasks }}
  72. -PtestLatestDeps=true
  73. ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
  74. - name: Build scan
  75. if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
  76. run: cat build-scan.txt
  77. - name: Upload deadlock detector artifacts if any
  78. if: failure()
  79. uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
  80. with:
  81. name: deadlock-detector-test-latest-${{ matrix.test-java-version }}-${{ matrix.vm }}-${{ matrix.test-partition }}
  82. path: /tmp/deadlock-detector-*
  83. if-no-files-found: ignore
  84. - name: Upload jvm crash dump files if any
  85. if: failure()
  86. uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
  87. with:
  88. name: javacore-test-latest-${{ matrix.test-java-version }}-${{ matrix.test-partition }}
  89. path: |
  90. **/hs_err_pid*.log
  91. **/javacore.*.txt
  92. **/Snap.*.trc
  93. **/core.*.dmp
  94. **/jitdump.*.dmp
  95. if-no-files-found: ignore