Skip to content

Switch to Java8 bytecode #23

Switch to Java8 bytecode

Switch to Java8 bytecode #23

Workflow file for this run

name: Pre Merge Checks
on:
push:
branches:
- "master" # run on master branch only - no need to start the job automatically otherwise
pull_request:
branches:
- "**" # run on PRs targeting ANY branch (assuming we check the Gradle wrapper first)
workflow_dispatch:
permissions:
contents: read
# kover-report action needs updating the PR report
pull-requests: write
jobs:
gradle:
strategy:
# don't fail immediately - otherwise failing build on Windows will cancel all other builds
fail-fast: false
matrix:
# build project on some operating systems
os: [ ubuntu-latest, windows-latest, macos-latest ]
# build on different java versions
jdk: [ 11, 17, 21 ]
runs-on: ${{ matrix.os }}
steps:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle#using-the-gradle-starter-workflow
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Protect from putting custom jar as a gradle wrapper
# https://github.com/gradle/actions/tree/main/wrapper-validation
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v5
# setup JDK - depending on version selected
# https://github.com/marketplace/actions/setup-java-jdk
- name: Set up JDK
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
# Optimize Gradle execution
# https://github.com/marketplace/actions/build-with-gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
# Build the project by simply running the command line
# No need to use daemon (this is run once container), however we print detailed logs and stacktraces
- name: Assemble the project
run: ./gradlew build --stacktrace --info --no-daemon
- name: Generate kover coverage report
run: ./gradlew koverXmlReport
# see https://github.com/marketplace/actions/kotlinx-kover-report
- name: Add coverage report to PR
id: kover
uses: mi-kas/kover-report@v1
with:
# we aggregate everything in root project
path: ${{ github.workspace }}/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
# We check that in root project - no need to repeat it once again
# min-coverage-overall: ???
# we can't validate this in Gradle - the report must do this on GitHub
# We aren't ready yet
min-coverage-changed-files: 90
coverage-counter-type: LINE