-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (56 loc) · 1.6 KB
/
Copy pathci.yml
File metadata and controls
66 lines (56 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
permissions:
contents: read
checks: write
pull-requests: write
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build and run tests
run: mvn clean verify -B
- name: Check code format
run: mvn fmt:check -B
- name: Upload JaCoCo report
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco/
retention-days: 14
- name: Add coverage to PR
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
uses: madrapps/jacoco-report@v1.7.1
with:
paths: target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
title: "Test Coverage Report"
update-comment: true
- name: Publish test results
if: >-
always() &&
(github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository)
uses: dorny/test-reporter@v1
with:
name: Test Results
path: target/surefire-reports/*.xml
reporter: java-junit