Skip to content

Commit f9f6e25

Browse files
committed
try
1 parent 2dc89de commit f9f6e25

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/unit-tests.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Unit tests and Coverage
22
on:
33
pull_request:
4-
types: [ opened, synchronize ]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- combined-sdk
@@ -10,21 +10,40 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
distribution: [ 'zulu', 'temurin' ]
14-
java: [ '8', '11', '17' ]
13+
distribution: ['zulu', 'temurin']
14+
java: ['8', '11', '17']
1515
name: Java ${{ matrix.java }} (${{ matrix.distribution }})
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19+
1920
- name: Setup Java
2021
uses: actions/setup-java@v4
2122
with:
2223
distribution: ${{ matrix.distribution }}
2324
java-version: ${{ matrix.java }}
2425
cache: 'gradle'
25-
- name: Build and test
26-
run: ./gradlew check --stacktrace
27-
- name: Coverage
26+
27+
- name: Build and run tests
28+
run: ./gradlew clean test --stacktrace
29+
30+
- name: Generate JaCoCo report
31+
run: ./gradlew jacocoTestReport --stacktrace
32+
33+
- name: Check JaCoCo XML
34+
run: |
35+
FILE="build/reports/jacoco/test/jacocoTestReport.xml"
36+
echo "Checking $FILE"
37+
ls -l build/reports/jacoco/test/
38+
if [ ! -s "$FILE" ]; then
39+
echo "ERROR: jacocoTestReport.xml is empty!"
40+
exit 1
41+
else
42+
echo "$FILE exists and has size $(stat -c%s "$FILE")"
43+
head -n 20 "$FILE"
44+
fi
45+
- name: Upload coverage to Coveralls
46+
if: success()
2847
env:
2948
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: ./gradlew jacocoTestReport coverallsJacoco
49+
run: ./gradlew coverallsJacoco --stacktrace

0 commit comments

Comments
 (0)