Skip to content

Commit 1a856bc

Browse files
committed
chore: integrates publishing of unit test results in GitHub
1 parent 7ef7870 commit 1a856bc

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/bff_develop.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,42 @@ jobs:
4444
- name: build, package and publish the image
4545
run: |
4646
VER_TAG=$(echo ${{ steps.meta.outputs.tags }} | cut --delimiter=: --fields=2-3)
47-
mvn -B clean package spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=$VER_TAG
47+
mvn -B clean verify spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=$VER_TAG
4848
env:
4949
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
5050
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}
51+
52+
- name: Upload Unit Test Results
53+
if: always()
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: unit-test-results
57+
path: |
58+
**/surefire-reports/*.xml
59+
**/failsafe-reports/*.xml
60+
61+
publish-test-results:
62+
name: "Publish Unit Tests Results"
63+
needs: build
64+
runs-on: ubuntu-latest
65+
# the build job might be skipped, we don't need to run this job then
66+
if: success() || failure()
67+
steps:
68+
- name: Download Artifacts
69+
uses: actions/download-artifact@v2
70+
with:
71+
name: unit-test-results
72+
path: reports
73+
74+
- name: Publish Unit Test Results
75+
uses: EnricoMi/publish-unit-test-result-action@v1
76+
with:
77+
files: reports/**/*.xml
5178

5279
container_scan:
5380
name: Trivy Container Scan
5481
needs: build
55-
runs-on: ubuntu-20.04
82+
runs-on: ubuntu-latest
5683
steps:
5784
- name: Checkout code
5885
uses: actions/checkout@v2.3.4

0 commit comments

Comments
 (0)