-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (45 loc) · 1.27 KB
/
maven.yml
File metadata and controls
52 lines (45 loc) · 1.27 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
name: Java CI with Maven
on:
push:
branches: [ main ]
paths:
- 'src/**'
- 'pom.xml'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'pom.xml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: cat .mvn/settings.xml && mvn -B clean verify --settings .mvn/settings.xml
env:
SPRING_COMMANDER_USERNAME: ${{ vars.SPRING_COMMANDER_USERNAME }}
SPRING_COMMANDER_TOKEN: ${{ secrets.SPRING_COMMANDER_TOKEN }}
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: target/site/jacoco/
- name: Generate coverage badge
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: target/site/jacoco/jacoco.csv
badges-directory: badges
generate-branches-badge: true
- name: Commit coverage badges
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update coverage badges"
branch: main
file_pattern: badges/*