From ab4c98899ef04863ccd5c5f5a47260d403169c31 Mon Sep 17 00:00:00 2001 From: Krishnan Mahadevan Date: Fri, 2 Jun 2023 11:22:49 +0530 Subject: [PATCH] Test Results as artifacts for failed runs --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c0a224a0b..c2229c57f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,7 @@ jobs: jdkFile: '${{ runner.temp }}/java_package.tar.gz' architecture: x64 - name: Test + id: run_test_cases uses: burrunan/gradle-cache-action@v1 with: job-id: jdk${{ matrix.jdk.version }} @@ -71,3 +72,13 @@ jobs: build properties: | testng.test.extra.jvmargs=${{ matrix.testExtraJvmArgs }} + - name: 'Generate unique build id' + id: build_id + if: ${{ steps.run_test_cases.outcome == 'failure' }} + run: echo "id=$(date +%s)" >> $GITHUB_OUTPUT + - name: Upload build reports + if: ${{ steps.run_test_cases.outcome == 'failure' }} + uses: actions/upload-artifact@v3 + with: + name: build-reports-${{ matrix.jdk.group }}-${{ matrix.jdk.version }}-${{ steps.build_id.outputs.id }} + path: testng-core/build/reports/tests/test/**