Skip to content

Commit

Permalink
workflow fixed
Browse files Browse the repository at this point in the history
added publish test report
  • Loading branch information
Moieen Abbas committed May 23, 2024
1 parent 690292c commit 630a199
Showing 1 changed file with 46 additions and 17 deletions.
63 changes: 46 additions & 17 deletions .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ on:
types: [ created ]

jobs:
build:
setup:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]

permissions:
contents: write
packages: write

steps:
- name: Check out source code
uses: actions/checkout@v4
Expand All @@ -41,6 +37,18 @@ jobs:
*.gradle*
**/gradle-wrapper.properties
build-linux:
needs: setup
runs-on: ubuntu-latest

permissions:
contents: write
packages: write
checks: write
# only needed unless run with comment_mode: off
pull-requests: write

steps:
- name: Make gradlew executable
run: chmod +x ./gradlew

Expand All @@ -54,36 +62,57 @@ jobs:
if: failure()
uses: actions/upload-artifact@v3
with:
name: reports
name: test-reports-linux
path: |
**/build/reports/
**/build/test-results/
publish-test-results:
name: "Publish Tests Results"
needs: build
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
check_name: "Junit Linux Test Report"
with:
files: |
**/test-results/**/*.xml
**/test-results/**/*.trx
**/test-results/**/*.json
build-win:
needs: setup
runs-on: ubuntu-latest

permissions:
contents: write
packages: write
checks: write

# only needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
# contents: read
steps:
- name: Gradle Build started
run: ./gradlew clean build --no-daemon

# only needed for private repository
# issues: read
if: always()
- name: Store reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-reports-window
path: |
**/build/reports/
**/build/test-results/
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
check_name: "Junit Windows Test Report"
with:
files: |
**/test-results/**/*.xml
Expand All @@ -92,7 +121,7 @@ jobs:
release:
name: "Release"
needs: build
needs: [ build-linux, build-win ]
runs-on: windows-latest
permissions:
contents: write
Expand Down

0 comments on commit 630a199

Please sign in to comment.