forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (202 loc) · 6.6 KB
/
code-coverage.yml
File metadata and controls
208 lines (202 loc) · 6.6 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: code-coverage
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
pull_request:
paths:
- '.github/workflows/code-coverage.yml'
env:
DEFAULT_MAVEN_OPTS: >-
-Xms6g
-Xmx6g
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN
DEVELOCITY_ACCESS_KEY: ${{ secrets.NIFI_DEVELOCITY_ACCESS_KEY }}
permissions:
contents: read
jobs:
unit-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
name: Run Unit Tests
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 21
cache: 'maven'
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Maven Build
env:
MAVEN_OPTS: >-
${{ env.DEFAULT_MAVEN_OPTS }}
run: >
./mvnw --fail-fast --no-snapshot-updates --no-transfer-progress --show-version
--threads 1C
-P report-code-coverage
jacoco:prepare-agent
verify
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: github.repository_owner == 'apache'
with:
files: ./nifi-code-coverage/target/site/jacoco-aggregate/jacoco.xml
flags: unit-tests
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
integration-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
name: Run Integration Tests
env:
MAVEN_BUILD_ARGUMENTS: >-
verify
-P skip-unit-tests
-P integration-tests
-P nifi-registry-integration-tests
-P report-code-coverage
MAVEN_BUILD_EXCLUDE_PROJECTS: >-
-pl -:minifi-assembly
-pl -:nifi-assembly
-pl -:nifi-toolkit-assembly
-pl -:nifi-registry-assembly
-pl -:nifi-registry-toolkit-assembly
-pl -:nifi-runtime-manifest
-pl -:nifi-runtime-manifest-test
-pl -:nifi-stateless-assembly
-pl -:nifi-stateless-system-test-suite
-pl -:nifi-system-test-suite
-pl -:nifi-nar-provider-assembly
-pl -:nifi-py4j-integration-tests
-pl -:nifi-docs
-pl -:nifi-maven-archetypes
-pl -:nifi-processor-bundle-archetype
-pl -:nifi-service-bundle-archetype
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 21
cache: 'maven'
- name: Maven Integration Tests with Coverage
env:
MAVEN_OPTS: >-
${{ env.DEFAULT_MAVEN_OPTS }}
TESTCONTAINERS_REUSE_ENABLE: true
run: >
./mvnw --fail-fast --no-snapshot-updates --no-transfer-progress --show-version
${{ env.MAVEN_BUILD_ARGUMENTS }}
${{ env.MAVEN_BUILD_EXCLUDE_PROJECTS }}
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: github.repository_owner == 'apache'
with:
files: ./nifi-code-coverage/target/site/jacoco-aggregate/jacoco.xml
flags: integration-tests
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
system-tests:
timeout-minutes: 120
runs-on: ubuntu-24.04
name: Run System Tests
env:
MAVEN_BUILD_ARGUMENTS: >-
install
-D skipTests
-pl nifi-code-coverage
-am
MAVEN_RUN_ARGUMENTS: >-
verify
-P integration-tests
-P report-code-coverage
-D include-python-integration-tests=true
MAVEN_PROJECTS: >-
-pl :nifi-python-framework
-pl :nifi-python-extension-api
-pl :nifi-python-test-extensions
-pl :nifi-py4j-integration-tests
-pl nifi-system-tests/nifi-system-test-suite
-pl nifi-system-tests/nifi-stateless-system-test-suite
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 21
cache: 'maven'
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Set up Astral uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: false
- name: Build Dependencies
env:
MAVEN_OPTS: >-
${{ env.DEFAULT_MAVEN_OPTS }}
run: >
./mvnw
-V
-nsu
-ntp
-ff
${{ env.MAVEN_BUILD_ARGUMENTS }}
${{ env.MAVEN_PROJECTS }}
- name: Download JaCoCo Agent
run: |
JACOCO_VERSION=$(./mvnw help:evaluate -Dexpression=jacoco.version -q -DforceStdout 2>/dev/null)
./mvnw dependency:copy -Dartifact=org.jacoco:org.jacoco.agent:${JACOCO_VERSION}:jar:runtime -DoutputDirectory=target/jacoco-agent
echo "JACOCO_AGENT_PATH=$(pwd)/target/jacoco-agent/org.jacoco.agent-${JACOCO_VERSION}-runtime.jar" >> $GITHUB_ENV
- name: Run System Tests with Coverage
env:
MAVEN_OPTS: >-
${{ env.DEFAULT_MAVEN_OPTS }}
JACOCO_AGENT_PATH: ${{ env.JACOCO_AGENT_PATH }}
run: >
./mvnw
-V
-nsu
-ntp
-ff
${{ env.MAVEN_RUN_ARGUMENTS }}
${{ env.MAVEN_PROJECTS }}
- name: Collect and Convert Coverage Files
if: always()
run: .github/scripts/collect-system-tests-coverage.sh
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: github.repository_owner == 'apache'
with:
files: target/system-tests-coverage/jacoco.xml
flags: system-tests
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true