Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,6 @@ on:


jobs:
test:
name: Test
runs-on: ubuntu-latest

permissions:
contents: write
checks: write

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Cache Gradle
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Set up GraalVM JDK 21
uses: actions/setup-java@v5
with:
distribution: graalvm
java-version: 21
cache: gradle

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Run Tests with Gradle
run: ./gradlew test --no-daemon --stacktrace

- name: Report test results
uses: dorny/test-reporter@v2
if: always()
with:
name: Gradle Tests
path: build/test-results/test/*.xml
reporter: java-junit
fail-on-error: true

build:
name: Build
runs-on: ubuntu-latest
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Coverage Check

on:
pull_request:
paths-ignore:
- ".gitignore"
- "LICENSE"
- "README.md"
- ".coderabbit.yaml"
- ".github/renovate.json"
branches: [ '**' ]
push:
paths-ignore:
- ".gitignore"
- "LICENSE"
- "README.md"
- ".coderabbit.yaml"
- ".github/renovate.json"
branches: [ 'master' ]

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up GraalVM JDK 21
uses: actions/setup-java@v5
with:
distribution: graalvm
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5

- name: Run unit tests
run: ./gradlew jacocoTestReport --refresh-dependencies --no-daemon

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/test-results/test/TEST-*.xml
codecov_yml_path: ./codecov.yml
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
id("xyz.jpenilla.run-paper") version "3.0.2"
id("com.gradleup.shadow") version "9.3.1"
id("maven-publish")
id("jacoco")
}

val minecraftVersion: String by project
Expand Down Expand Up @@ -84,6 +85,23 @@ tasks {
}
}

check {
dependsOn(jacocoTestReport)
}

jacocoTestReport {
dependsOn(test)
reports {
xml.required.set(true)
html.required.set(true)
html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
}
}

jacoco {
toolVersion = "0.8.14"
}

javadoc {
isFailOnError = false
options.encoding = "UTF-8"
Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github_checks: true

comment:
layout: "header, diff, flags, components"
Loading