-
Notifications
You must be signed in to change notification settings - Fork 22
54 lines (45 loc) · 1.58 KB
/
maven.yml
File metadata and controls
54 lines (45 loc) · 1.58 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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ "master" ]
#pull_request:
#branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN}}
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B test --file pom.xml
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: jacoco-report/target/site/jacoco/jacoco.csv
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Commit and push the badge (if it changed)
uses: EndBug/add-and-commit@v7
with:
author_name: Mom0aut
author_email: reinhart19_91@hotmail.com
message: '[skip ci] commit badge'
add: '*.svg'
- name: Upload JaCoCo coverage report
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: jacoco-report/target/site/jacoco/