forked from eclipse-ee4j/openmq
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (171 loc) · 5.71 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
#
# Copyright (c) 2021, 2022 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: [ 17 ]
steps:
- name: Checkout for build
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Test Maven Build
run: ./mvnw --show-version --no-transfer-progress --activate-profiles staging --file mq install
- name: Upload MQ Distribution
uses: actions/upload-artifact@v3
with:
name: mq-distribution
retention-days: 1
path: mq/dist/bundles/mq.zip
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@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Build OpenMQ
run: ./mvnw --show-version --no-transfer-progress --file mq --define skipTests install
smoke:
name: Smoke Tests ${{ matrix.mq_command }} @ Java ${{ matrix.java_version }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [ 11 ]
mq_command: [
'imqadmin',
'imqbridgemgr',
'imqbrokerd',
'imqcmd',
'imqdbmgr',
'imqobjmgr',
'imqusermgr'
]
steps:
- name: Download MQ Distribution
uses: actions/download-artifact@v4.1.7
with:
name: mq-distribution
- name: Unzip MQ Distribution
run: unzip -q mq.zip
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
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 }}
needs: smoke
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Checkout for build
uses: actions/checkout@v3
- 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
ln mq/binary/linux/opt/obj/cclient/libmqcrt.so.* mq/binary/linux/opt/obj/cclient/libmqcrt.so
- name: Build mqcrt library (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
ant -f mq/main/packager-opensource buildcclient
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/opt/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.1.7
with:
name: mq-distribution
- name: Unpack MQ Distribution
run: unzip -q -d mq/dist mq.zip
- name: Start MQ Broker Daemon
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: Produce message (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "OpenMQ Test message from workflow" | \
LD_LIBRARY_PATH=mq/binary/linux/opt/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/opt/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