-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.57 KB
/
build.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
name: "build"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# job 1: Test based on java 8 and 21. Do not checkstyle.
build:
name: "build"
services:
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8, 21 ]
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Set up Java JDK"
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
# step 3
- name: "Print maven version"
run: ./mvnw -version
# step 4.1
- name: "Test, Check style, Check PMD, Check license with Maven and Java8"
if: matrix.java == '8'
run: |
./mvnw -T 4C clean test \
-Dmaven.git-commit-id.skip=true \
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# step 4.2
- name: "Test with Maven and Java${{ matrix.java }}"
if: matrix.java != '8'
run: |
./mvnw -T 4C clean test \
-Dmaven.git-commit-id.skip=true \
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# step 5
- name: "Codecov"
if: matrix.java == '8'
uses: codecov/[email protected]