forked from wildfly/quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
238 lines (232 loc) · 11.9 KB
/
quickstart_ejb-txn-remote-call_ci.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
229
230
231
232
233
234
235
236
237
238
name: WildFly ejb-txn-remote-call Quickstart CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'ejb-txn-remote-call/**'
- .github/workflows/quickstart_ci.yml
# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref || github.run_id }}'
cancel-in-progress: true
env:
QUICKSTART_PATH: ejb-txn-remote-call
TEST_PROVISIONED_SERVER: true
TEST_BOOTABLE_JAR: false
TEST_OPENSHIFT: true
MATRIX_JDK: '"11", "17"'
MATRIX_OS: '"ubuntu-latest"'
SERVER_PROVISIONING_SERVER_HOST: 'http://localhost'
EXTRA_RUN_ARGS: '-DpostgresqlUsername="test" -DpostgresqlPassword="test"'
WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS: '-Dwildfly-glow-galleon-feature-packs-url=https://raw.githubusercontent.com/wildfly/wildfly-galleon-feature-packs/main/'
jobs:
Matrix-Setup:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.setup-matrix-os.outputs.os }}
jdk: ${{ steps.setup-matrix-jdk.outputs.jdk }}
steps:
- id: setup-matrix-jdk
run: echo 'jdk=[${{ env.MATRIX_JDK }}]' >> $GITHUB_OUTPUT
- id: setup-matrix-os
run: echo 'os=[${{ env.MATRIX_OS }}]' >> $GITHUB_OUTPUT
Test-build-default-matrix:
name: BUILD DEFAULT - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: Matrix-Setup
strategy:
fail-fast: false
matrix:
jdk: ${{ fromJSON(needs.Matrix-Setup.outputs.jdk) }}
os: ${{ fromJSON(needs.Matrix-Setup.outputs.os) }}
steps:
- uses: actions/checkout@v4
with:
path: quickstarts
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Run before script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ env.QUICKSTART_PATH }}_ci_before.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- name: Build ${{ env.QUICKSTART_PATH }} Quickstart for Release
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}
mvn -fae clean install -Drelease
shell: bash
- name: Build, run & test ${{ env.QUICKSTART_PATH }} Quickstart with provisioned-server profile
if: ${{ env.TEST_PROVISIONED_SERVER }}
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}/client
echo "Building 'client' provisioned server..."
mvn -fae clean package -Pprovisioned-server -DremoteServerUsername="quickstartUser" -DremoteServerPassword="quickstartPwd1!"
mvn wildfly:start -Djboss-as.home=target/server -Dwildfly.javaOpts="-Djboss.tx.node.id=server1 -Djboss.node.name=server1" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
cd ../server
echo "Building 'server' provisioned server..."
mvn -fae clean package -Pprovisioned-server -Dwildfly.provisioning.dir=server2 -Djboss-as.home=target/server2
mvn -fae package -Pprovisioned-server -Dwildfly.provisioning.dir=server3 -Djboss-as.home=target/server3
echo "Add quickstartUser to both 'server' builds..."
./target/server2/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' -g 'guest,user,JBossAdmin,Users'
./target/server3/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' -g 'guest,user,JBossAdmin,Users'
echo "Add quickstartAdmin to both 'server' builds..."
./target/server2/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' -g 'guest,user,admin'
./target/server3/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' -g 'guest,user,admin'
echo "Starting provisioned server..."
mvn wildfly:start -Djboss-as.home=target/server2 -Dwildfly.port=10090 -Dwildfly.serverConfig=standalone-ha.xml -Dwildfly.javaOpts="-Djboss.socket.binding.port-offset=100 -Djboss.tx.node.id=server2 -Djboss.node.name=server2" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
mvn wildfly:start -Djboss-as.home=target/server3 -Dwildfly.port=10190 -Dwildfly.serverConfig=standalone-ha.xml -Dwildfly.javaOpts="-Djboss.socket.binding.port-offset=200 -Djboss.tx.node.id=server3 -Djboss.node.name=server3" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
echo "Testing provisioned server..."
cd ../client
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8080/client -Pintegration-testing
cd ../server
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8180/server -Pintegration-testing
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8280/server -Pintegration-testing
echo "Shutting down provisioned server..."
cd ../client
mvn wildfly:shutdown
cd ../server
mvn wildfly:shutdown -Dwildfly.port=10090
mvn wildfly:shutdown -Dwildfly.port=10190
shell: bash
- name: Build ${{ env.QUICKSTART_PATH }} Quickstart with openshift profile
if: ${{ env.TEST_OPENSHIFT }}
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}/client
mvn -fae clean package -Popenshift -DremoteServerUsername="quickstartUser" -DremoteServerPassword="quickstartPwd1!"
cd ../server
mvn -fae clean package -Popenshift
shell: bash
- name: Run after script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ env.QUICKSTART_PATH }}_ci_after.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/${{ env.QUICKSTART_PATH }}/**/surefire-reports/*.txt'
# Use the shared-wildfly-build workflow to have a consistent WildFly build. Note the branch names MUST match what
# is used in WildFly.
WildFly-build:
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build.yml@main
with:
wildfly-branch: ${{ github.base_ref }}
wildfly-repo: "wildfly/wildfly"
Test-build-with-deps-matrix:
name: BUILD WITH DEPS - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [Matrix-Setup, WildFly-build]
strategy:
fail-fast: false
matrix:
jdk: ${{ fromJSON(needs.Matrix-Setup.outputs.jdk) }}
os: ${{ fromJSON(needs.Matrix-Setup.outputs.os) }}
steps:
- uses: actions/checkout@v4
with:
path: quickstarts
- uses: actions/download-artifact@v4
with:
name: wildfly-maven-repository
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf wildfly-maven-repository.tar.gz -C ~
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Run before script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ env.QUICKSTART_PATH }}_ci_before.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- name: Build Quickstart for Release with built Server version
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}
mvn -fae clean package -Drelease -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
shell: bash
- name: Build, run & test ${{ env.QUICKSTART_PATH }} Quickstart with provisioned-server profile, and built Server version
if: ${{ env.TEST_PROVISIONED_SERVER }}
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}/client
echo "Building 'client' provisioned server..."
mvn -fae clean package -Pprovisioned-server -DremoteServerUsername="quickstartUser" -DremoteServerPassword="quickstartPwd1!" -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
mvn wildfly:start -Djboss-as.home=target/server -Dwildfly.javaOpts="-Djboss.tx.node.id=server1 -Djboss.node.name=server1" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
cd ../server
echo "Building 'server' provisioned server..."
mvn -fae clean package -Pprovisioned-server -Dwildfly.provisioning.dir=server2 -Djboss-as.home=target/server2 -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
mvn -fae package -Pprovisioned-server -Dwildfly.provisioning.dir=server3 -Djboss-as.home=target/server3 -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
echo "Add quickstartUser to both 'server' builds..."
./target/server2/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' -g 'guest,user,JBossAdmin,Users'
./target/server3/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' -g 'guest,user,JBossAdmin,Users'
echo "Add quickstartAdmin to both 'server' builds..."
./target/server2/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' -g 'guest,user,admin'
./target/server3/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' -g 'guest,user,admin'
echo "Starting provisioned server..."
mvn wildfly:start -Djboss-as.home=target/server2 -Dwildfly.port=10090 -Dwildfly.serverConfig=standalone-ha.xml -Dwildfly.javaOpts="-Djboss.socket.binding.port-offset=100 -Djboss.tx.node.id=server2 -Djboss.node.name=server2" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
mvn wildfly:start -Djboss-as.home=target/server3 -Dwildfly.port=10190 -Dwildfly.serverConfig=standalone-ha.xml -Dwildfly.javaOpts="-Djboss.socket.binding.port-offset=200 -Djboss.tx.node.id=server3 -Djboss.node.name=server3" -Dstartup-timeout=120 ${{env.EXTRA_RUN_ARGS}}
echo "Testing provisioned server..."
cd ../client
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8080/client -Pintegration-testing
cd ../server
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8180/server -Pintegration-testing
mvn -fae verify -Dserver.host=${{ env.SERVER_PROVISIONING_SERVER_HOST }}:8280/server -Pintegration-testing
echo "Shutting down provisioned server..."
cd ../client
mvn wildfly:shutdown
cd ../server
mvn wildfly:shutdown -Dwildfly.port=10090
mvn wildfly:shutdown -Dwildfly.port=10190
shell: bash
- name: Build ${{ env.QUICKSTART_PATH }} Quickstart with openshift profile, and built Server version
if: ${{ env.TEST_OPENSHIFT }}
run: |
cd quickstarts
cd ${{ env.QUICKSTART_PATH }}/client
mvn -fae clean package -Popenshift -DremoteServerUsername="quickstartUser" -DremoteServerPassword="quickstartPwd1!" -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
cd ../server
mvn -fae clean package -Popenshift -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }} ${{ env.WILDFLY_SNAPSHOT_EXTRA_PACKAGE_ARGUMENTS }}
shell: bash
- name: Run after script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ env.QUICKSTART_PATH }}_ci_after.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/**/surefire-reports/*.txt'