Skip to content

Commit

Permalink
Merge pull request #4789 from kgudel/githubActions
Browse files Browse the repository at this point in the history
Add unit tests with github actions
  • Loading branch information
jaredb96 authored Apr 4, 2024
2 parents debd13b + b5cd14e commit 6b05d66
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflow/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: HMDA Unit Tests

on:
pull_request:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest

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

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

- name: Run Sbt Tests
run: |
touch log-file
sbt test > log-file
continue-on-error: true

- name: Check Test Results
run: |
if [ $(cat log-file | grep -E "TEST FAILED|TESTS FAILED|Failed tests" | wc -l) -gt 0 ]; then
echo "Unit tests failed."
exit 1
else
echo "Unit tests passed."
fi

0 comments on commit 6b05d66

Please sign in to comment.