reusable-test-latest-deps.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. GE_CACHE_USERNAME:
  15. required: false
  16. GE_CACHE_PASSWORD:
  17. required: false
  18. jobs:
  19. test-latest-deps:
  20. name: testLatestDeps${{ matrix.test-partition }}
  21. runs-on: ubuntu-latest
  22. strategy:
  23. matrix:
  24. test-partition:
  25. - 0
  26. - 1
  27. - 2
  28. - 3
  29. fail-fast: false
  30. steps:
  31. - uses: actions/checkout@v4
  32. - name: Free disk space
  33. run: .github/scripts/gha-free-disk-space.sh
  34. - name: Set up JDK for running Gradle
  35. uses: actions/setup-java@v4
  36. with:
  37. distribution: temurin
  38. java-version: 17.0.6
  39. - name: Increase gradle daemon heap size
  40. run: |
  41. sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
  42. # vaadin tests use pnpm
  43. - name: Cache pnpm modules
  44. uses: actions/cache@v3
  45. with:
  46. path: ~/.pnpm-store
  47. key: ${{ runner.os }}-test-latest-cache-pnpm-modules
  48. - name: List tests
  49. env:
  50. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  51. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  52. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  53. uses: gradle/gradle-build-action@v2
  54. with:
  55. arguments: >
  56. check -x spotlessCheck
  57. listTestsInPartition
  58. -PtestPartition=${{ matrix.test-partition }}
  59. -PtestLatestDeps=true
  60. cache-read-only: true
  61. - name: Set test tasks
  62. run: |
  63. echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
  64. - name: Test
  65. uses: gradle/gradle-build-action@v2
  66. env:
  67. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  68. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  69. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  70. with:
  71. arguments: >
  72. ${{ env.test-tasks }}
  73. -PtestLatestDeps=true
  74. ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
  75. cache-read-only: ${{ inputs.cache-read-only }}
  76. # gradle enterprise is used for the build cache
  77. gradle-home-cache-excludes: caches/build-cache-1