This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
forked from soartech/jsoar
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 2.73 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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: Maven Build
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java: [ 15 ]
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- name: Checkout code
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@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw -B package --file pom.xml "-Dmaven.wagon.http.retryHandler.count=10" "-Dhttp.keepAlive=false" "-Dmaven.wagon.http.pool=false" "-Dmaven.wagon.httpconnectionManager.ttlSeconds=120" -e
- name: Publish Unit Test Results
# Version 1.17
#uses: EnricoMi/publish-unit-test-result-action@2c1638db7746f235576536a706b83d2eece7f413
#uses: scacap/[email protected]
uses: mikepenz/action-junit-report@v2
if: failure()
with:
report_paths: '**/surefire-reports/TEST-*.xml'
# with:
# files: target/surefire-reports/**/*.xml
analyse:
runs-on: ubuntu-latest
name: Analyse code
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 15
uses: actions/setup-java@v1
with:
java-version: 15
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Check java code formatting
run: ./mvnw -B fmt:check
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B verify --file pom.xml "-Dmaven.wagon.http.retryHandler.count=10" "-Dhttp.keepAlive=false" "-Dmaven.wagon.http.pool=false" "-Dmaven.wagon.httpconnectionManager.ttlSeconds=120" -e jacoco:report-aggregate org.sonarsource.scanner.maven:sonar-maven-plugin:sonar