reusable-test-indy.yml 2.7 KB

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