-
Notifications
You must be signed in to change notification settings - Fork 18
226 lines (208 loc) · 7.96 KB
/
hivemq-platform-operator-integration-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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: HiveMQ Platform Operator Integration Tests
on:
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: hivemq-operator-platform-integration-test-${{ github.ref }}
cancel-in-progress: true
jobs:
platform-integration-test-compose:
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
test-plan: [
Extensions1,
Extensions2,
ContainerSecurityContext,
MonitoringOperator,
MonitoringPlatform,
PodSecurityContext,
Upgrade,
Other
]
steps:
- name: Checkout HiveMQ Helm Charts
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: helm-charts
- name: Set up Docker QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Login to Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Checkout HiveMQ Platform Operator on the default branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
repository: hivemq/hivemq-platform-operator
token: ${{ secrets.JENKINS_GITHUB_TOKEN }}
path: hivemq-platform-operator
- name: Checkout HiveMQ Platform Operator on the same or target branch
working-directory: ${{ github.workspace }}/hivemq-platform-operator
run: |
echo "Checking if branch \"${GITHUB_HEAD_REF}\" exists on hivemq-platform-operator"
BRANCH=$(git ls-remote origin ${GITHUB_HEAD_REF})
if [[ -n "${BRANCH}" ]]; then
echo "Checking out branch with the same name"
git fetch --all
git checkout origin/${GITHUB_HEAD_REF}
exit
fi
if [[ "${GITHUB_BASE_REF}" == "master" ]]; then
exit
fi
echo "Checking if branch \"${GITHUB_BASE_REF}\" exists on hivemq-platform-operator"
BRANCH=$(git ls-remote origin ${GITHUB_BASE_REF})
if [[ -n "${BRANCH}" ]]; then
echo "Checking out target branch"
git fetch --all
git checkout origin/${GITHUB_BASE_REF}
fi
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4
with:
gradle-home-cache-includes: |
caches
notifications
jdks
- name: Run HiveMQ Platform Operator integration tests
env:
TEST_PLAN: ${{ matrix.test-plan }}
working-directory: helm-charts
run: ./gradlew :tests-hivemq-platform-operator:integrationTest --tests "*.compose.*"
- name: Upload HiveMQ Platform Operator test results
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: Test results HiveMQ Platform Operator - Compose ${{ matrix.test-plan }}
path: |
helm-charts/tests-hivemq-platform-operator/build/reports/tests/integrationTest/
helm-charts/tests-hivemq-platform-operator/build/test-results/integrationTest/*.xml
retention-days: 5
- name: Publish test report
uses: mikepenz/action-junit-report@a427a90771729d8f85b6ab0cdaa1a5929cab985d # v5
if: always()
with:
annotate_only: true
detailed_summary: true
job_name: integration-test-compose-report
report_paths: '**/build/test-results/integrationTest/TEST-*.xml'
platform-integration-test-single:
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
test-plan: [
AdditionalBrokerLicense,
BrokerLicense,
Containers,
ContainerSecurityContextInstallPlatform,
ContainerSecurityContextUpgradePlatform,
ClusterDomainName,
CustomLogback,
CustomOperatorConfig,
CustomValues,
CustomSecretConfig,
DataHubLicense,
ExtensionsLicense,
Platform,
PodSecurityContextInstallPlatform,
PodSecurityContextUpgradePlatform,
ServiceAccount,
Services1,
Services2,
Services3,
Services4,
Volumes,
Other
]
steps:
- name: Checkout HiveMQ Platform Helm Charts
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: helm-charts
- name: Set up Docker QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Login to Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Checkout HiveMQ Platform Operator on the default branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
repository: hivemq/hivemq-platform-operator
token: ${{ secrets.JENKINS_GITHUB_TOKEN }}
path: hivemq-platform-operator
- name: Checkout HiveMQ Platform Operator on the same or target branch
working-directory: ${{ github.workspace }}/hivemq-platform-operator
run: |
echo "Checking if branch \"${GITHUB_HEAD_REF}\" exists on hivemq-platform-operator"
BRANCH=$(git ls-remote origin ${GITHUB_HEAD_REF})
if [[ -n "${BRANCH}" ]]; then
echo "Checking out branch with the same name"
git fetch --all
git checkout origin/${GITHUB_HEAD_REF}
exit
fi
if [[ "${GITHUB_BASE_REF}" == "master" ]]; then
exit
fi
echo "Checking if branch \"${GITHUB_BASE_REF}\" exists on hivemq-platform-operator"
BRANCH=$(git ls-remote origin ${GITHUB_BASE_REF})
if [[ -n "${BRANCH}" ]]; then
echo "Checking out target branch"
git fetch --all
git checkout origin/${GITHUB_BASE_REF}
fi
- name: Set up JDK 11
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4
with:
gradle-home-cache-includes: |
caches
notifications
jdks
- name: Run HiveMQ Platform Operator integration tests
env:
TEST_PLAN: ${{ matrix.test-plan }}
working-directory: helm-charts
run: ./gradlew :tests-hivemq-platform-operator:integrationTest --tests "*.single.*"
- name: Upload HiveMQ Platform Operator test results
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: Test results HiveMQ Platform Operator - Single ${{ matrix.test-plan }}
path: |
helm-charts/tests-hivemq-platform-operator/build/reports/tests/integrationTest/
helm-charts/tests-hivemq-platform-operator/build/test-results/integrationTest/*.xml
retention-days: 5
- name: Publish test report
uses: mikepenz/action-junit-report@a427a90771729d8f85b6ab0cdaa1a5929cab985d # v5
if: always()
with:
annotate_only: true
detailed_summary: true
job_name: integration-test-single-report
report_paths: '**/build/test-results/integrationTest/TEST-*.xml'