Skip to content

Commit 34b05af

Browse files
committed
Add GH actions setup.
1 parent 483798a commit 34b05af

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/maven.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Build
5+
6+
on:
7+
push:
8+
branches: [ main, 3.1.x ]
9+
pull_request:
10+
branches: [ main, 3.1.x ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK
20+
uses: actions/setup-java@v2
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
- name: Cache local Maven repository
25+
uses: actions/cache@v2
26+
with:
27+
path: ~/.m2/repository
28+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: |
30+
${{ runner.os }}-maven-
31+
- name: Build with Maven
32+
run: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
33+
- name: Publish Test Report
34+
uses: mikepenz/action-junit-report@v2
35+
if: always() # always run even if the previous step fails
36+
with:
37+
report_paths: '**/surefire-reports/TEST-*.xml'
38+
- name: Archive code coverage results
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: surefire-reports
42+
path: '**/surefire-reports/*'

0 commit comments

Comments
 (0)