Skip to content

Add github actions for unit tests and code quality #11

Add github actions for unit tests and code quality

Add github actions for unit tests and code quality #11

Workflow file for this run

name: JUnit Tests
on:
pull_request:
permissions:
contents: read
actions: read
checks: write
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'temurin'
architecture: x64
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Grant Permissions to gradlew
run: chmod +x gradlew
- name: Run Gradle build and run tests
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
- run: ./gradlew koverXmlReport
- name: Add coverage report to PR
id: kover
uses: mi-kas/kover-report@v1
with:
path: |
${{ github.workspace }}/buffer/build/reports/kover/report.xml
${{ github.workspace }}/cache/build/reports/kover/report.xml
${{ github.workspace }}/engine/build/reports/kover/report.xml
${{ github.workspace }}/game/build/reports/kover/report.xml
${{ github.workspace }}/network/build/reports/kover/report.xml
${{ github.workspace }}/types/build/reports/kover/report.xml
${{ github.workspace }}/yaml/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
min-coverage-overall: 80
min-coverage-changed-files: 80
coverage-counter-type: LINE