Skip to content

Commit 6b05d66

Browse files
authored
Merge pull request #4789 from kgudel/githubActions
Add unit tests with github actions
2 parents debd13b + b5cd14e commit 6b05d66

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflow/unit-tests.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: HMDA Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
tests:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup JDK
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '17'
20+
distribution: 'adopt'
21+
22+
- name: Run Sbt Tests
23+
run: |
24+
touch log-file
25+
sbt test > log-file
26+
continue-on-error: true
27+
28+
- name: Check Test Results
29+
run: |
30+
if [ $(cat log-file | grep -E "TEST FAILED|TESTS FAILED|Failed tests" | wc -l) -gt 0 ]; then
31+
echo "Unit tests failed."
32+
exit 1
33+
else
34+
echo "Unit tests passed."
35+
fi

0 commit comments

Comments
 (0)