From 78d2e72950173bad840f01b55e3286032734d4e6 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Mon, 2 Jun 2025 18:22:13 +0300 Subject: [PATCH 1/4] Merge steps for uploading test results into separate job --- .github/workflows/ci.yml | 58 +++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 666add7d4..da0775636 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,6 @@ on: - neo workflow_dispatch: -permissions: - checks: write - pull-requests: write - jobs: ci-core: name: Run core tests on JDK ${{ matrix.jdk }} @@ -44,18 +40,18 @@ jobs: - name: Build and run tests run: ./gradlew --scan build -x :jacodb-ets:build - - name: Publish test results - uses: EnricoMi/publish-unit-test-result-action@v2 - if: (!cancelled()) - with: - files: "**/build/test-results/**/*.xml" - check_name: "Test results on JDK ${{ matrix.jdk }}" - - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload Gradle test results + if: (!cancelled()) + uses: actions/upload-artifact@v4 + with: + name: gradle-test-results-${{ matrix.jdk }}" + path: "**/build/test-results/**/*.xml" + - name: Upload Gradle reports if: (!cancelled()) uses: actions/upload-artifact@v4 @@ -90,12 +86,12 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} - - name: Publish test results - uses: EnricoMi/publish-unit-test-result-action@v2 + - name: Upload Gradle test results if: (!cancelled()) + uses: actions/upload-artifact@v4 with: - files: "**/build/test-results/**/*.xml" - check_name: "Lifecycle test results" + name: gradle-test-results-lifecycle + path: "**/build/test-results/**/*.xml" ci-ets: name: Run ETS tests @@ -147,9 +143,41 @@ jobs: - name: Run ETS tests run: ./gradlew --scan :jacodb-ets:generateTestResources :jacodb-ets:test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload Gradle test results + if: (!cancelled()) + uses: actions/upload-artifact@v4 + with: + name: gradle-test-results-${{ matrix.jdk }}" + path: "**/build/test-results/**/*.xml" + - name: Upload Gradle reports if: (!cancelled()) uses: actions/upload-artifact@v4 with: name: gradle-reports-ets path: '**/build/reports/' + + publish-test-results: + name: "Publish test results" + needs: [ ci-core, ci-lifecycle, ci-ets ] + if: (!cancelled()) + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: "artifacts/gradle-test-results-*/**/*.xml" From 3204fd05e672e66dfa4b4ab7c02ff3901bad8cc5 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Mon, 2 Jun 2025 18:32:21 +0300 Subject: [PATCH 2/4] Fix artifact name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da0775636..c9c1cb33f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: if: (!cancelled()) uses: actions/upload-artifact@v4 with: - name: gradle-test-results-${{ matrix.jdk }}" + name: gradle-test-results-ets path: "**/build/test-results/**/*.xml" - name: Upload Gradle reports From 4f99cf9ba2ec533cb5375d3ad7845275db3e4776 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Mon, 2 Jun 2025 18:32:50 +0300 Subject: [PATCH 3/4] Upload Gradle reports in ci-lifecycle job --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9c1cb33f..9d17c659a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,13 @@ jobs: name: gradle-test-results-lifecycle path: "**/build/test-results/**/*.xml" + - name: Upload Gradle reports + if: (!cancelled()) + uses: actions/upload-artifact@v4 + with: + name: gradle-reports-lifecycle + path: '**/build/reports/' + ci-ets: name: Run ETS tests runs-on: ubuntu-24.04 From b52aa72c02ea4920b8e0d472378e7fbffd154d13 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Mon, 2 Jun 2025 18:34:07 +0300 Subject: [PATCH 4/4] Remove extra quote --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d17c659a..f68595a70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: if: (!cancelled()) uses: actions/upload-artifact@v4 with: - name: gradle-test-results-${{ matrix.jdk }}" + name: gradle-test-results-${{ matrix.jdk }} path: "**/build/test-results/**/*.xml" - name: Upload Gradle reports