reusable-test-indy.yml 3.0 KB

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