Skip to content

Commit

Permalink
feat: support multi module builds for services
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Nov 14, 2023
1 parent ebefa30 commit a867ddb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/gradle-service-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: Image tag to scan after build
required: true
type: string
multi-module:
description: If this is a multi-module project
type: boolean
default: false
secrets:
# GH_PAT:
# required: true
Expand Down Expand Up @@ -57,7 +61,7 @@ jobs:
uses: wetransform/gha-trivy@master
with:
image-ref: 'docker.io/${{ inputs.image-tag }}'
junit-test-output: 'build/test-results/trivy.xml' # added to unit test report
junit-test-output: "${{ inputs.multi-module && 'trivy-gha-scan/build/test-results/trivy.xml' || 'build/test-results/trivy.xml' }}" # added to unit test report
report-retention-days: 14

#
Expand All @@ -69,7 +73,7 @@ jobs:
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'build/test-results/**/*.xml'
report_paths: "${{ inputs.multi-module && '*/test-results/**/*.xml' || 'build/test-results/**/*.xml' }}"
require_tests: true

# Workaround for check that is additionally created being associated
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/gradle-service-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: Image tag to scan after build
required: true
type: string
multi-module:
description: If this is a multi-module project
type: boolean
default: false
secrets:
# GH_PAT:
# required: true
Expand Down Expand Up @@ -57,7 +61,7 @@ jobs:
uses: wetransform/gha-trivy@master
with:
image-ref: 'docker.io/${{ inputs.image-tag }}'
junit-test-output: 'build/test-results/trivy.xml' # added to unit test report
junit-test-output: "${{ inputs.multi-module && 'trivy-gha-scan/build/test-results/trivy.xml' || 'build/test-results/trivy.xml' }}" # added to unit
report-retention-days: 90 # default retention

#
Expand All @@ -69,7 +73,7 @@ jobs:
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'build/test-results/**/*.xml'
report_paths: "${{ inputs.multi-module && '*/test-results/**/*.xml' || 'build/test-results/**/*.xml' }}"
require_tests: true
fail_on_failure: true # required for slack notification if only tests fail

Expand Down

0 comments on commit a867ddb

Please sign in to comment.