Skip to content

Commit cc04ab6

Browse files
committed
try
1 parent 59ea6ed commit cc04ab6

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

.github/workflows/unit-tests.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
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
8+
89
jobs:
910
build-and-test:
1011
runs-on: ubuntu-latest
1112
strategy:
1213
matrix:
13-
distribution: [ 'zulu', 'temurin' ]
14-
java: [ '8', '11', '17' ]
14+
distribution: ['zulu', 'temurin']
15+
java: ['8', '11', '17']
1516
name: Java ${{ matrix.java }} (${{ matrix.distribution }})
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@v4
20+
1921
- name: Setup Java
2022
uses: actions/setup-java@v4
2123
with:
2224
distribution: ${{ matrix.distribution }}
2325
java-version: ${{ matrix.java }}
2426
cache: 'gradle'
25-
- name: Build and test
26-
run: ./gradlew check --stacktrace
27-
- name: Coverage
27+
28+
- name: Build and run tests
29+
run: ./gradlew clean test --stacktrace
30+
31+
- name: Generate JaCoCo report
32+
run: ./gradlew jacocoTestReport --stacktrace
33+
34+
- name: Check JaCoCo XML
35+
run: |
36+
FILE="build/reports/jacoco/test/jacocoTestReport.xml"
37+
echo "Checking $FILE"
38+
ls -l build/reports/jacoco/test/
39+
if [ ! -s "$FILE" ]; then
40+
echo "ERROR: jacocoTestReport.xml is empty!"
41+
exit 1
42+
else
43+
echo "$FILE exists and has size $(stat -c%s "$FILE")"
44+
head -n 20 "$FILE"
45+
fi
46+
47+
- name: Upload coverage to Coveralls
48+
if: success()
2849
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: ./gradlew jacocoTestReport coverallsJacoco
50+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
51+
run: ./gradlew coverallsJacoco --stacktrace

0 commit comments

Comments
 (0)