-
Notifications
You must be signed in to change notification settings - Fork 34
228 lines (213 loc) · 7.21 KB
/
maven.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
227
228
#
# Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0,
# or the Eclipse Distribution License v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
name: Eclipse OpenMQ CI
on:
pull_request:
jobs:
build:
name: Test on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java_version: [ 21 ]
steps:
- name: Checkout for build
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Test Maven Build
run: ./mvnw --show-version --no-transfer-progress --activate-profiles staging --file mq/main install --define build.letter=g --define build.number=${GITHUB_REF_NAME}/${GITHUB_SHA}/${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}.${GITHUB_RUN_ATTEMPT}
- name: Upload MQ Distribution
uses: actions/upload-artifact@v4
with:
name: mq-distribution
retention-days: 1
path: mq/dist/bundles/mq.zip
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout for build
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Docs Maven Build
run: ./mvnw --show-version --no-transfer-progress --activate-profiles staging --file docs install
build-with-no-staging:
name: Build with no staging repository, using only central-released artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout for build
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Build OpenMQ
run: |
./mvnw \
--show-version \
--no-transfer-progress \
--file mq/main \
--define skipTests \
--define gpg.skip \
--activate-profiles oss-release \
install
smoke:
name: Smoke Tests ${{ matrix.mq_command }} @ Java ${{ matrix.java_version }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [ 21 ]
mq_command: [
'imqadmin',
'imqbridgemgr',
'imqbrokerd',
'imqcmd',
'imqdbmgr',
'imqobjmgr',
'imqusermgr'
]
steps:
- name: Download MQ Distribution
uses: actions/download-artifact@v4
with:
name: mq-distribution
- name: Unzip MQ Distribution
run: unzip -q mq.zip
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Execute MQ Command
run: mq/bin/${{ matrix.mq_command}} -version
test-mqcrt-client:
name: Test MQCRT Library on ${{ matrix.os }}/JDK ${{ matrix.java_version }}
needs: smoke
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
java_version: [ 21 ]
steps:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Checkout for build
uses: actions/checkout@v4
- name: Install required libraries (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get update && sudo apt-get install -y libnspr4-dev libnss3-dev
- name: Install required libraries (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: brew update && brew install nspr nss
- name: Build mqcrt library (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
ant -f mq/main/packager-opensource buildcclient -Dbuild.debug=true
ln mq/binary/linux/debug/obj/cclient/libmqcrt.so.* mq/binary/linux/debug/obj/cclient/libmqcrt.so
- name: Build mqcrt library (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
ant -f mq/main/packager-opensource buildcclient \
-Dnsprhome.opt.mac=/opt/homebrew \
-Dnsshome.opt.mac=/opt/homebrew \
-Dmqcrt.linkdirs.opt.mac=-L/opt/homebrew/lib
cp mq/binary/mac/opt/obj/cclient/libmqcrt.dylib .
- name: Build Producer and Consumer (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
for B in Producer Consumer
do
g++ -L mq/binary/linux/debug/obj/cclient \
-I mq/src/share/cclient/cshim \
mq/src/share/cclient/examples/C/producer_consumer/${B}.c \
-o ${B} \
-lmqcrt -lnspr4 -lssl3
done
- name: Build Producer and Consumer (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
for B in Producer Consumer
do
c++ -L mq/binary/mac/opt/obj/cclient \
-I mq/src/share/cclient/cshim \
mq/src/share/cclient/examples/C/producer_consumer/${B}.c \
-o ${B} \
-lmqcrt
done
- name: Download MQ Distribution
uses: actions/download-artifact@v4
with:
name: mq-distribution
- name: Unpack MQ Distribution
run: unzip -q -d mq/dist mq.zip
- name: Start MQ Broker Daemon (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
timeout-minutes: 2
run: |
nohup mq/dist/mq/bin/imqbrokerd -verbose > brokerd.log 2>&1 &
while [ true ]
do
grep "Broker .*:7676.*ready" brokerd.log && break
sleep 10s
done
- name: Start MQ Broker Daemon (macos)
if: ${{ matrix.os == 'macos-latest' }}
timeout-minutes: 2
run: |
nohup mq/dist/mq/bin/imqbrokerd -verbose > brokerd.log 2>&1 &
while [ true ]
do
grep "Broker .*:7676.*ready" brokerd.log && break
sleep 10
done
- name: Produce message (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "OpenMQ Test message from workflow" | \
LD_LIBRARY_PATH=mq/binary/linux/debug/obj/cclient ./Producer -t queue
- name: Produce message (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
echo "OpenMQ Test message from workflow" | ./Producer -t queue
- name: Consume message (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
timeout-minutes: 1
run: |
LD_LIBRARY_PATH=mq/binary/linux/debug/obj/cclient ./Consumer -t queue | \
tee consumer.log
- name: Consume message (macos)
if: ${{ matrix.os == 'macos-latest' }}
timeout-minutes: 1
run: |
./Consumer -t queue | tee consumer.log
- name: Verify consumed message
run: grep "OpenMQ Test message from workflow" consumer.log
- name: Upload logs on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-mqcrt-client-brokerd-log-${{ matrix.java_version }}-${{ matrix.os }}
path: brokerd.log