Skip to content

Commit

Permalink
chore: integrates publishing of unit test results in GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
jekutzsche committed Sep 23, 2021
1 parent 7ef7870 commit 7ed21c6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/bff_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,42 @@ jobs:
- name: build, package and publish the image
run: |
VER_TAG=$(echo ${{ steps.meta.outputs.tags }} | cut --delimiter=: --fields=2-3)
mvn -B clean package spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=$VER_TAG
mvn -B clean verify spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=$VER_TAG
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}

- name: Upload Test Reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: |
**/surefire-reports/*.xml
**/failsafe-reports/*.xml
publish-test-results:
name: Publish Test Results
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: test-reports
path: reports

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: reports/**/*.xml
report_individual_runs: true
check_run_annotations_branch: "*"

container_scan:
name: Trivy Container Scan
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release-gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,33 @@ jobs:
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.JK_GITHUB_TOKEN }}

- name: Upload Test Reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: |
**/surefire-reports/*.xml
**/failsafe-reports/*.xml
publish-test-results:
name: Publish Test Results
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: test-reports
path: reports

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: reports/**/*.xml
report_individual_runs: true
check_run_annotations_branch: "*"

container_scan:
needs: release-client
Expand Down
2 changes: 1 addition & 1 deletion .prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mvn versions:set -DnewVersion=$VERSION -DprocessAllModules=true

# Package the new version and copy it to release folder
# These files will be upload to github by @semantic-release/github
mvn -B clean package spring-boot:repackage spring-boot:build-image -Dspring-boot.build-image.publish=false
mvn -B clean verify spring-boot:repackage spring-boot:build-image -Dspring-boot.build-image.publish=false
mkdir release && cp ./iris-client-bff/target/*.jar release

BFF_IMAGE_NAME="$NAMESPACE/iris-client-bff"
Expand Down

0 comments on commit 7ed21c6

Please sign in to comment.