From 630a199f4f5f05e3f32ca75a8538acc475aea7f0 Mon Sep 17 00:00:00 2001 From: Moieen Abbas Date: Thu, 23 May 2024 19:47:29 +0500 Subject: [PATCH] workflow fixed added publish test report --- .github/workflows/gradle-release.yml | 63 ++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/.github/workflows/gradle-release.yml b/.github/workflows/gradle-release.yml index 3baf5e2..36ca2eb 100644 --- a/.github/workflows/gradle-release.yml +++ b/.github/workflows/gradle-release.yml @@ -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 @@ -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 @@ -54,29 +62,49 @@ 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: @@ -84,6 +112,7 @@ jobs: - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 + check_name: "Junit Windows Test Report" with: files: | **/test-results/**/*.xml @@ -92,7 +121,7 @@ jobs: release: name: "Release" - needs: build + needs: [ build-linux, build-win ] runs-on: windows-latest permissions: contents: write