-
Notifications
You must be signed in to change notification settings - Fork 36
125 lines (122 loc) · 5.07 KB
/
test.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: tests
on: [push, pull_request, workflow_dispatch]
permissions: read-all
jobs:
code-analysis:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17' ]
name: Java ${{ matrix.java }} code analysis
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-ca-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-ca-
- name: Code Analysis
run: mvn --batch-mode --activate-profiles github install pmd:check pmd:cpd-check license:check javadoc:jar -DskipTests=true
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17' ]
name: Java ${{ matrix.java }} unit test
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-ut-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-ut-
- name: Unit Tests
run: mvn --batch-mode --activate-profiles github test jacoco:report
- name: Upload test coverage report
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
with:
files: ./ecaudit/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./eclog/target/site/jacoco/jacoco.xml
flags: unit-tests
fail_ci_if_error: false
verbose: true
unit-tests-java-target:
runs-on: ubuntu-latest
name: Java 17 target 17 unit test
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-ut-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-ut-
- name: Unit Tests
run: mvn --batch-mode --activate-profiles github test jacoco:report -Dmaven.compiler.target=17 -Dmaven.compiler.source=17
- name: Upload test coverage report
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
with:
files: ./ecaudit/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./eclog/target/site/jacoco/jacoco.xml
flags: unit-tests
fail_ci_if_error: false
verbose: true
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17' ]
name: Java ${{ matrix.java }} integration tests
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-it-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-it-
- name: Integration Tests
run: mvn --batch-mode --activate-profiles github test-compile failsafe:integration-test failsafe:verify
integration-tests-java-target:
runs-on: ubuntu-latest
name: Java 17 target 17 integration tests
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-it-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-it-
- name: Integration Tests
run: mvn --batch-mode --activate-profiles github test-compile failsafe:integration-test failsafe:verify -Dmaven.compiler.target=17 -Dmaven.compiler.source=17