-
Notifications
You must be signed in to change notification settings - Fork 144
61 lines (58 loc) · 1.84 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
58
59
60
61
# 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:
workflow_dispatch:
push:
branches: [ master ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8', '11', '17']
steps:
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.java }}-maven-
- name: Set up build JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Build with Maven
run: mvn -B -V -DskipTests=true package --file pom.xml
- uses: actions/upload-artifact@v3
with:
name: java-${{ matrix.java }}-jars
path: |
**/target/*.jar
**/target/bom.*
if: always()
- name: Set up test JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
check-latest: true
- name: Test with Maven
run: mvn -B -V -P coverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dmaven.main.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -DskipITs=false --file pom.xml
- uses: actions/upload-artifact@v3
with:
name: java-${{ matrix.java }}-testresults
path: |
**/target/surefire-reports/
**/target/failsafe-reports/
**/target/site/jacoco/
**/target/site/jacoco-it/
if: always()