-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.8 KB
/
maven.yml
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
# This workflow will build a Java project with Maven
# 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: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
packages: read
# If uncommented, set the java version below to ${{ matrix.java }}
#strategy:
# matrix:
# java: [ '11', '17' ]
steps:
# Note: this action must be first, as actions/setup-java needs it to set up the maven cache
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
# Since August 2021, this replaces AdoptOpenJDK ('adopt')
distribution: 'temurin'
java-version: '17'
cache: 'maven'
check-latest: true
- name: Build with Maven and Run Tests
run: mvn --batch-mode --update-snapshots verify
- name: Archive code coverage report
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: target/site/jacoco/
retention-days: 2
- name: Publish Test Coverage Results
# noinspection SpellCheckingInspection
uses: PavanMudigonda/[email protected]
with:
coverage_results_path: 'target/site/jacoco/jacoco.xml'
coverage_report_title: 'Test Coverage Results'
coverage_report_name: 'Test Coverage Results'
github_token: ${{ secrets.GITHUB_TOKEN }}
# Option: use GitHub secrets to add deployment to Maven Central. See:
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#publishing-using-apache-maven