From d7b5b97a08497fa185e9d3e082c0b54e03736fd2 Mon Sep 17 00:00:00 2001 From: Himanshu Kandwal Date: Tue, 16 Jan 2024 11:12:26 -0800 Subject: [PATCH] Updating the Github CI/CD actions to have automated unit tests reporting.. (#2727) * [apache/helix] -- Updated GitHub actions file to generate unit tests reports. --- .github/workflows/Helix-CI.yml | 18 +++++++++++++++++- .github/workflows/Helix-Manual-CI.yml | 23 ++++++++++++++++++----- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Helix-CI.yml b/.github/workflows/Helix-CI.yml index 556c079c22..fc837116bc 100644 --- a/.github/workflows/Helix-CI.yml +++ b/.github/workflows/Helix-CI.yml @@ -5,6 +5,8 @@ on: schedule: - cron: '0 */12 * * *' +permissions: write-all + jobs: Merge_PR_CI: @@ -25,10 +27,24 @@ jobs: - name: Upload to Codecov run: bash <(curl -s https://codecov.io/bash) if: ${{ github.repository == 'apache/helix' && github.event_name == 'push' && (success() || failure()) }} + - name: Generate Test Report + uses: dorny/test-reporter@v1 + if: ${{ success() || failure() }} + with: + name: Tests Results + path: './**/target/surefire-reports/TEST-TestSuite.xml' + reporter: java-junit + - name: Upload Unit Test Results as Artifacts + if: failure() + uses: actions/upload-artifact@v2 + with: + name: surefire-reports + path: ./**/target/surefire-reports/ + if-no-files-found: ignore - name: Print Tests Results run: .github/scripts/printTestResult.sh if: ${{ success() || failure() }} - - name: Report Tests Results + - name: Report Failed Tests as GitHub Issues uses: actions/github-script@v4 with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/Helix-Manual-CI.yml b/.github/workflows/Helix-Manual-CI.yml index f349e3303a..f14b862417 100644 --- a/.github/workflows/Helix-Manual-CI.yml +++ b/.github/workflows/Helix-Manual-CI.yml @@ -15,6 +15,8 @@ on: required: true default: -fae test +permissions: write-all + jobs: MANUAL_CI: @@ -24,16 +26,27 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.buildRef }} - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 - name: Delete frontend-maven-plugin dir run: rm -rf .m2\repository\com\github\eirslett - name: Build with Maven run: mvn clean install -Dmaven.test.skip.exec=true -DretryFailedDeploymentCount=5 - name: Run All Tests run: mvn -B -V -e -ntp "-Dstyle.color=always" ${{ github.event.inputs.mvnOpts }} ${{ github.event.inputs.goals }} - - name: Print Tests Results - run: .github/scripts/printTestResult.sh - if: ${{ success() || failure() }} + - name: Test Report + uses: dorny/test-reporter@v1 + if: always() + with: + name: Tests Results + path: './**/target/surefire-reports/TEST-TestSuite.xml' + reporter: java-junit + - name: Upload unit test results + if: failure() + uses: actions/upload-artifact@v2 + with: + name: surefire-reports + path: ./**/target/surefire-reports/ + if-no-files-found: ignore