-
Notifications
You must be signed in to change notification settings - Fork 370
58 lines (51 loc) · 1.65 KB
/
pr-builder.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
# This workflow will build the project on pull requests with tests
# Uses:
# OS: ubuntu-latest
# JDK: Adopt JDK 11 and Adopt JDK 17
name: PR Builder
on:
pull_request:
branches: [main, master]
workflow_dispatch:
env:
MAVEN_OPTS: -Xmx4g -Xms1g
jobs:
build:
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: "-Djdk.util.zip.disableZip64ExtraFieldValidation=true -Djdk.nio.zipfs.allowDotZipEntry=true"
strategy:
matrix:
# Will add the 17 once Nashorn is removed.
java-version: [ 11 ]
steps:
- uses: actions/checkout@v2
- name: Set up Adopt JDK 11 and 17
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: "adopt"
- name: Cache local Maven repository
id: cache-maven-m2
uses: actions/cache@v2
env:
cache-name: cache-m2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ env.cache-name }}-
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Build with Maven
run: mvn clean install -U -B
- name: Delete SNAPSHOT artifacts
run: find ~/.m2/repository/ -name "*-SNAPSHOT" -type d -print -prune -exec rm -r {} +
- name: Generate coverage report
run: mvn test jacoco:report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files : target/site/jacoco/jacoco.xml
flags: unit