name: Reusable - Test latest deps on: workflow_call: inputs: cache-read-only: type: boolean required: false no-build-cache: type: boolean required: false max-test-retries: type: string required: false secrets: FLAKY_TEST_REPORTER_ACCESS_KEY: required: false permissions: contents: read jobs: test-indy: name: testIndy${{ matrix.test-partition }} runs-on: ubuntu-latest strategy: matrix: test-partition: - 0 - 1 - 2 - 3 fail-fast: false steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Free disk space run: .github/scripts/gha-free-disk-space.sh - name: Set up JDK for running Gradle uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: distribution: temurin java-version-file: .java-version - name: Increase gradle daemon heap size run: | sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties # vaadin 14 tests fail with node 18 - name: Set up Node uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: node-version: 16 # vaadin tests use pnpm - name: Cache pnpm modules uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: ~/.pnpm-store key: ${{ runner.os }}-test-latest-cache-pnpm-modules - name: Setup Gradle uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 with: cache-read-only: ${{ inputs.cache-read-only }} - name: List tests run: > ./gradlew check -x spotlessCheck listTestsInPartition -PtestPartition=${{ matrix.test-partition }} - name: Set test tasks run: | echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV - name: Test run: > ./gradlew ${{ env.test-tasks }} -PtestIndy=true ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} ${{ inputs.max-test-retries && format(' -PmaxTestRetries={0}', inputs.max-test-retries) || '' }} - name: Build scan if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} run: cat build-scan.txt - name: Get current job url id: jobs if: ${{ !cancelled() }} uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 env: matrix: ${{ toJson(matrix) }} with: result-encoding: string script: | const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({ owner: context.repo.owner, repo: context.repo.repo, run_id: context.runId, per_page: 100 }); const matrix = JSON.parse(process.env.matrix); const job_name = `test-indy / testIndy${ matrix['test-partition'] }`; return workflow_run.jobs.find((job) => job.name === job_name).html_url; - name: Flaky test report if: ${{ !cancelled() }} env: FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }} JOB_URL: ${{ steps.jobs.outputs.result }} run: | if [ -s build-scan.txt ]; then export BUILD_SCAN_URL=$(cat build-scan.txt) fi ./gradlew :test-report:reportFlakyTests