From 51d7596f725e64aa0dbd741d9f679a81b7191457 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Sat, 3 Apr 2021 21:04:29 +0200 Subject: [PATCH 1/3] Upload the Surefire reports as artifacts --- .github/workflows/ci-actions-incremental.yml | 54 ++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml index 0387d4ea9ad8b..e37ed705db752 100644 --- a/.github/workflows/ci-actions-incremental.yml +++ b/.github/workflows/ci-actions-incremental.yml @@ -220,6 +220,12 @@ jobs: with: name: test-reports-linux-jvm${{matrix.java.name}} path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-jvm-linux-jdk${{matrix.java.name}} + path: "**/target/surefire-reports/TEST-*.xml" windows-jdk11-jvm-tests: name: JVM Tests - JDK 11 Windows @@ -266,6 +272,12 @@ jobs: with: name: test-reports-windows-jdk11-jvm path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-jvm-windows-jdk11 + path: "**/target/surefire-reports/TEST-*.xml" linux-jvm-maven-tests: name: Maven Tests - JDK ${{matrix.java.name}} @@ -314,6 +326,12 @@ jobs: with: name: test-reports-linux-maven-java${{matrix.java.name}} path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-maven-linux-jdk${{matrix.java.name}} + path: "**/target/surefire-reports/TEST-*.xml" windows-jdk11-jvm-maven-tests: name: Maven Tests - JDK 11 Windows @@ -357,6 +375,12 @@ jobs: with: name: test-reports-windows-maven-java11 path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-maven-windows-jdk11 + path: "**/target/surefire-reports/TEST-*.xml" gradle-tests-jdk11-jvm: name: Gradle Tests - JDK 11 ${{matrix.os.family}} @@ -461,6 +485,12 @@ jobs: with: name: test-reports-linux-devtools-java${{matrix.java.name}} path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-devtools-linux-jdk${{matrix.java.name}} + path: "**/target/surefire-reports/TEST-*.xml" windows-jdk11-jvm-devtools-tests: name: Devtools Tests - JDK 11 Windows @@ -504,6 +534,12 @@ jobs: with: name: test-reports-windows-devtools-java11 path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-devtools-windows-jdk${{matrix.java.name}} + path: "**/target/surefire-reports/TEST-*.xml" tcks-test: name: MicroProfile TCKs Tests @@ -560,6 +596,12 @@ jobs: with: name: test-reports-tcks path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-microprofile-tck-tests + path: "**/target/surefire-reports/TEST-*.xml" native-tests-read-json-matrix: name: Native Tests - Read JSON matrix @@ -639,6 +681,12 @@ jobs: with: name: test-reports-native-${{matrix.category}} path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-native-linux-${{matrix.category}} + path: "**/target/surefire-reports/TEST-*.xml" native-tests-windows: name: Native Tests - Windows - ${{matrix.category}} needs: [build-jdk11, native-tests-read-json-matrix] @@ -715,3 +763,9 @@ jobs: with: name: test-reports-native-windows-${{matrix.category}} path: 'test-reports.tgz' + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-native-windows-${{matrix.category}} + path: "**/target/surefire-reports/TEST-*.xml" From b29602ca39da04b184b55e191b9eface9acc9c7b Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Sat, 3 Apr 2021 22:29:30 +0200 Subject: [PATCH 2/3] Generalize to Failsafe and Gradle reports and adjust retention --- .github/workflows/ci-actions-incremental.yml | 40 ++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml index e37ed705db752..9a0368161b1c3 100644 --- a/.github/workflows/ci-actions-incremental.yml +++ b/.github/workflows/ci-actions-incremental.yml @@ -225,7 +225,8 @@ jobs: if: failure() with: name: surefire-reports-jvm-linux-jdk${{matrix.java.name}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 windows-jdk11-jvm-tests: name: JVM Tests - JDK 11 Windows @@ -277,7 +278,8 @@ jobs: if: failure() with: name: surefire-reports-jvm-windows-jdk11 - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 linux-jvm-maven-tests: name: Maven Tests - JDK ${{matrix.java.name}} @@ -331,7 +333,8 @@ jobs: if: failure() with: name: surefire-reports-maven-linux-jdk${{matrix.java.name}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 windows-jdk11-jvm-maven-tests: name: Maven Tests - JDK 11 Windows @@ -380,7 +383,8 @@ jobs: if: failure() with: name: surefire-reports-maven-windows-jdk11 - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 gradle-tests-jdk11-jvm: name: Gradle Tests - JDK 11 ${{matrix.os.family}} @@ -395,11 +399,13 @@ jobs: os: - { name: "ubuntu-latest", - family: "Linux" + family: "Linux", + path: "linux" } - { name: "windows-latest", - family: "Windows" + family: "Windows", + path: "windows" } steps: - uses: actions/checkout@v2 @@ -437,6 +443,13 @@ jobs: - name: Build with Gradle via Maven shell: bash run: mvn $JVM_TEST_MAVEN_OPTS install -pl integration-tests/gradle ${{ needs.build-jdk11.outputs.gib_args }} + - name: Upload Surefire reports (if build failed) + uses: actions/upload-artifact@v2 + if: failure() + with: + name: surefire-reports-gradle-${{ matrix.os.path }}-jdk11 + path: "**/build/test-results/test/TEST-*.xml" + retention-days: 2 linux-jvm-devtools-tests: name: Devtools Tests - JDK ${{matrix.java.name}} @@ -490,7 +503,8 @@ jobs: if: failure() with: name: surefire-reports-devtools-linux-jdk${{matrix.java.name}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 windows-jdk11-jvm-devtools-tests: name: Devtools Tests - JDK 11 Windows @@ -539,7 +553,8 @@ jobs: if: failure() with: name: surefire-reports-devtools-windows-jdk${{matrix.java.name}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 tcks-test: name: MicroProfile TCKs Tests @@ -601,7 +616,8 @@ jobs: if: failure() with: name: surefire-reports-microprofile-tck-tests - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 native-tests-read-json-matrix: name: Native Tests - Read JSON matrix @@ -686,7 +702,8 @@ jobs: if: failure() with: name: surefire-reports-native-linux-${{matrix.category}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 native-tests-windows: name: Native Tests - Windows - ${{matrix.category}} needs: [build-jdk11, native-tests-read-json-matrix] @@ -768,4 +785,5 @@ jobs: if: failure() with: name: surefire-reports-native-windows-${{matrix.category}} - path: "**/target/surefire-reports/TEST-*.xml" + path: "**/target/*-reports/TEST-*.xml" + retention-days: 2 From 2738d83941c79babd73e8ac7cc15b4c4917d7b2d Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Sun, 4 Apr 2021 12:13:36 +0200 Subject: [PATCH 3/3] Attach an artifact containing the pr number to the build --- .github/workflows/ci-actions-incremental.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml index 9a0368161b1c3..b86895db90dab 100644 --- a/.github/workflows/ci-actions-incremental.yml +++ b/.github/workflows/ci-actions-incremental.yml @@ -40,6 +40,25 @@ env: DB_PASSWORD: hibernate_orm_test DB_NAME: hibernate_orm_test jobs: + # This is a hack to work around a GitHub API limitation: + # when the PR is coming from another fork, the pull_requests field of the + # workflow_run payload is empty. + # For more details, see + # https://github.community/t/pull-request-attribute-empty-in-workflow-run-event-object-for-pr-from-forked-repo/154682 + attach-pr-number: + runs-on: ubuntu-latest + name: Attach pull request number + if: github.event_name == 'pull_request' + steps: + - name: Create file + shell: bash + run: | + echo -n ${{ github.event.number }} > pull-request-number + - name: Upload pull request number + uses: actions/upload-artifact@v2 + with: + name: pull-request-number-${{ github.event.number }} + path: pull-request-number ci-sanity-check: name: "CI Sanity Check" runs-on: ubuntu-latest