Skip to content

Commit

Permalink
Updating the Github CI/CD actions to have automated unit tests report…
Browse files Browse the repository at this point in the history
…ing.. (#2727)

* [apache/helix] -- Updated GitHub actions file to generate unit tests reports.
  • Loading branch information
himanshukandwal authored Jan 16, 2024
1 parent 2d6132c commit d7b5b97
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/Helix-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
schedule:
- cron: '0 */12 * * *'

permissions: write-all

jobs:
Merge_PR_CI:

Expand All @@ -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}}
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/Helix-Manual-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
required: true
default: -fae test

permissions: write-all

jobs:
MANUAL_CI:

Expand All @@ -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

0 comments on commit d7b5b97

Please sign in to comment.