-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper jobs & change failure of grype scan
- Loading branch information
1 parent
55ee0a0
commit f84b686
Showing
3 changed files
with
95 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.