Skip to content

Wip

Wip #19

Workflow file for this run

name: Unit tests and Coverage
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- combined-sdk
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
distribution: ['zulu', 'temurin']
java: ['8', '11', '17']
name: Java ${{ matrix.java }} (${{ matrix.distribution }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Build and run tests
run: ./gradlew clean test --stacktrace
- name: Generate JaCoCo report
run: ./gradlew jacocoTestReport --stacktrace
- name: Check JaCoCo XML
run: |
FILE="build/reports/jacoco/test/jacocoTestReport.xml"
echo "Checking $FILE"
ls -l build/reports/jacoco/test/
if [ ! -s "$FILE" ]; then
echo "ERROR: jacocoTestReport.xml is empty!"
exit 1
else
echo "$FILE exists and has size $(stat -c%s "$FILE")"
head -n 20 "$FILE"
fi
- name: Upload coverage to Coveralls
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew coverallsJacoco --stacktrace