reusable-test-latest-deps.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
  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: 17.0.6
  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: List tests
  49. env:
  50. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  51. uses: gradle/actions/setup-gradle@6cec5d49d4d6d4bb982fbed7047db31ea6d38f11 # v3.3.0
  52. with:
  53. arguments: >
  54. check -x spotlessCheck
  55. listTestsInPartition
  56. -PtestPartition=${{ matrix.test-partition }}
  57. -PtestLatestDeps=true
  58. cache-read-only: true
  59. - name: Set test tasks
  60. run: |
  61. echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
  62. - name: Test
  63. uses: gradle/actions/setup-gradle@6cec5d49d4d6d4bb982fbed7047db31ea6d38f11 # v3.3.0
  64. env:
  65. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  66. with:
  67. arguments: >
  68. ${{ env.test-tasks }}
  69. -PtestLatestDeps=true
  70. ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
  71. cache-read-only: ${{ inputs.cache-read-only }}
  72. # gradle enterprise is used for the build cache
  73. gradle-home-cache-excludes: caches/build-cache-1
  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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  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