Skip to content

Commit

Permalink
Add helper jobs & change failure of grype scan
Browse files Browse the repository at this point in the history
  • Loading branch information
DVentresco committed Jan 27, 2025
1 parent 55ee0a0 commit f84b686
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 336 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cve-scan-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
image: pr-cve-scan:latest
output-file: grype-report.txt
fail-build: false

- name: Upload Grype report to artifact
uses: actions/upload-artifact@v4
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/helper-functions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Helper Functions"
on:
workflow_call:
inputs:
service:
required: true
type: string
output-file:
required: true
type: string
jobs:
test-service:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup sbt launcher
uses: sbt/setup-sbt@v1

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'

- name: Run hmda-platform Tests
run: |
sbt "project ${{ inputs.service }}" "testOnly -- -l actions-ignore" 2>&1 | tee -a ${{ inputs.output-file }}
continue-on-error: true

- name: Check Test Results
run: |
if [ $(grep 'All tests passed.' ${{ inputs.output-file }} | wc -l) -ne 1 ]; then
echo "One or more projects had failures. Please review the logs."
cat ${{ inputs.output-file }}
exit 1
else
echo "All tests passed."
exit 0
fi
Loading

0 comments on commit f84b686

Please sign in to comment.