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. permissions:
  15. contents: read
  16. jobs:
  17. test-indy:
  18. name: testIndy${{ matrix.test-partition }}
  19. if: ${{ contains(github.event.pull_request.labels.*.name, 'test indy') }}
  20. runs-on: ubuntu-latest
  21. strategy:
  22. matrix:
  23. test-partition:
  24. - 0
  25. - 1
  26. - 2
  27. - 3
  28. fail-fast: false
  29. steps:
  30. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  31. - name: Free disk space
  32. run: .github/scripts/gha-free-disk-space.sh
  33. - name: Set up JDK for running Gradle
  34. uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
  35. with:
  36. distribution: temurin
  37. java-version-file: .java-version
  38. - name: Increase gradle daemon heap size
  39. run: |
  40. sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
  41. # vaadin 14 tests fail with node 18
  42. - name: Set up Node
  43. uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
  44. with:
  45. node-version: 16
  46. # vaadin tests use pnpm
  47. - name: Cache pnpm modules
  48. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
  49. with:
  50. path: ~/.pnpm-store
  51. key: ${{ runner.os }}-test-latest-cache-pnpm-modules
  52. - name: Setup Gradle
  53. uses: gradle/actions/setup-gradle@d9336dac04dea2507a617466bc058a3def92b18b # v3.4.0
  54. with:
  55. cache-read-only: ${{ inputs.cache-read-only }}
  56. # gradle enterprise is used for the build cache
  57. gradle-home-cache-excludes: caches/build-cache-1
  58. - name: List tests
  59. env:
  60. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  61. run: >
  62. ./gradlew
  63. check -x spotlessCheck
  64. listTestsInPartition
  65. -PtestPartition=${{ matrix.test-partition }}
  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. env:
  71. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  72. run: >
  73. ./gradlew
  74. ${{ env.test-tasks }}
  75. -PtestIndy=true
  76. ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
  77. - name: Build scan
  78. if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
  79. run: cat build-scan.txt