Skip to content

fix: setup java 11 before building #12

fix: setup java 11 before building

fix: setup java 11 before building #12

Workflow file for this run

name: test with coverage
on:
push:
pull_request:
jobs:
build:
name: Build and Run Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew build
- name: JaCoCo Coverage Report
if: runner.os != 'Windows'
env:
report_path: trees/build/jacoco/report.csv
run: |
awk -F"," '{ instructions += $4 + $5; covered += $5; branches += $6 + $7; branches_covered +=$7 } END { print "Instructions covered:", covered"/"instructions, "--", 100*covered/instructions"%"; print "Branches covered:", branches_covered"/"branches, "--", 100*branches_covered/branches"%" }' "$report_path"
- uses: actions/upload-artifact@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
name: test-and-coverage-reports
path: trees/build/reports
retention-days: 365