-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (51 loc) · 1.56 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
# This workflow will build a Java project with Maven
name: Java CI with Maven in Linux
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
# test against several Java versions:
matrix:
include:
- java: 8
additional-maven-args: >
-Pjacoco
-DrepoToken=$COVERALLS_REPO_TOKEN
-DpullRequest=${{ github.event.pull_request.number }}
coveralls:report
- java: 11
name: Build with Java ${{ matrix.java }} on Linux
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-jdk${{ matrix.java }}-${{ hashFiles('**/pom.xml', '**/*.yml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Build with Maven
run: >
mvn verify ${{ matrix.additional-maven-args }}
working-directory: com.examples.myproject
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
- name: Generate JUnit Report
run: >
mvn surefire-report:report-only site:site -DgenerateReports=false
working-directory: com.examples.myproject
if: ${{ always() }}
- name: Tree
run: tree
- name: Archive JUnit Report
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: surefire-report-jdk-${{ matrix.java }}
path: '**/target/site'