-
Notifications
You must be signed in to change notification settings - Fork 47
273 lines (273 loc) · 12.4 KB
/
main.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: CI on pull requests.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'docs/**'
env:
LANG: en_US.UTF-8
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
WILDFLY_S2I_BUILDER_IMAGE: wildfly/wildfly-s2i
WILDFLY_S2I_RUNTIME_IMAGE: wildfly/wildfly-runtime
# The image to copy in docker daemon for testing
UBUNTU_ARCHITECTURE_IMAGE: linuxamd64
BEHAVE_TIMEOUT: 60
jobs:
wfci:
name: Wildfly-s2i Build and Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
jdk: [jdk11, jdk17, jdk21]
steps:
- name: Update hosts - linux
if: matrix.os == 'ubuntu-latest'
run: |
cat /etc/hosts
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
sudo sysctl -w fs.file-max=2097152
- uses: actions/checkout@v2
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Docker and skopeo versions
run: |
docker version
skopeo --version
- name: 'Set up skopeo'
uses: warjiang/setup-skopeo@main
- name: skopeo updated version
run: |
ls -l
chmod +x ./skopeo
./skopeo --version
- name: Verify latest ubi8-minimal
run: |
podman pull registry.access.redhat.com/ubi8/ubi-minimal
podman image ls | grep ubi8
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install krb5-multidev libkrb5-dev
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.11.5'
- name: Setup virtualenv and install cekit and required packages
run: |
python --version
sudo pip install virtualenv
mkdir ~/cekit
python3 -m venv ~/cekit
. ~/cekit/bin/activate
pip install cekit docker docker-squash odcs behave lxml packaging
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Build DockerFiles
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
WILDFLY_IMAGE_VERSION=$(yq e ".version" ${{ matrix.jdk }}-overrides.yaml)
cekit build --dry-run --overrides=${{ matrix.jdk }}-overrides.yaml docker
popd
pushd wildfly-runtime-image
cekit build --dry-run --overrides=${{ matrix.jdk }}-overrides.yaml docker
popd
echo "WILDFLY_IMAGE_VERSION=${WILDFLY_IMAGE_VERSION}" >> $GITHUB_ENV
- name: Buildah multi archs Builder Build
id: build_builder_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}
tags: ${{ env.WILDFLY_IMAGE_VERSION }}
context: ./wildfly-builder-image/target/image
platforms: linux/amd64, linux/arm64, linux/ppc64le
containerfiles: |
./wildfly-builder-image/target/image/Dockerfile
- name: Buildah multi archs Runtime Build
id: build_runtime_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}
tags: ${{ env.WILDFLY_IMAGE_VERSION }}
context: ./wildfly-runtime-image/target/image
platforms: linux/amd64, linux/arm64, linux/ppc64le
containerfiles: |
./wildfly-runtime-image/target/image/Dockerfile
- name: Skopeo copy Builder and Runtime images to Docker local repo for tests
run: |
podman images
./skopeo --debug copy containers-storage:localhost/${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}-${{ env.UBUNTU_ARCHITECTURE_IMAGE }} docker-daemon:${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
./skopeo --debug copy containers-storage:localhost/${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}-${{ env.UBUNTU_ARCHITECTURE_IMAGE }} docker-daemon:${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
- name: List docker images
run: |
docker --version
docker info
docker image ls
docker inspect ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
docker run --rm ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} bash
- name: Behave Tests basic
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re basic > test-logs-basic-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-basic-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests datasources
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re datasources > test-logs-datasources-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-datasources-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests extensions
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re extensions > test-logs-extensions-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-extensions-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests jgroups
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re jgroups > test-logs-jgroups-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-jgroups-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests keycloak
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re keycloak > test-logs-keycloak-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-keycloak-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests legacy-elytron
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re legacy-elytron > test-logs-legacy-elytron-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-legacy-elytron-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests legacy-s2i
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re legacy-s2i > test-logs-legacy-s2i-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-legacy-s2i-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests messaging
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re messaging > test-logs-messaging-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-messaging-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests for jdk17+
if: matrix.jdk != 'jdk11'
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re no-jdk11 > test-logs-no-jdk11-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-no-jdk11-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests oidc
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re oidc > test-logs-oidc-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-oidc-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests s2i
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re s2i-tests > test-logs-s2i-tests-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-s2i-tests-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests server_builder
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re server_builder > test-logs-server_builder-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-server_builder-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests stability
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re stability > test-logs-stability-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-stability-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Behave Tests vanilla-basic
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave --include-re vanilla-basic > test-logs-vanilla-basic-${{ matrix.os }}-${{ matrix.jdk }}.txt 2>&1
rm test-logs-vanilla-basic-${{ matrix.os }}-${{ matrix.jdk }}.txt
popd
docker system prune -f
- name: Additional Tests
run: |
export IMAGE_VERSION=${{ env.WILDFLY_IMAGE_VERSION }}
export IMAGE_NAME=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}
export RUNTIME_IMAGE_NAME=${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}
. ~/cekit/bin/activate
./test/run
- name: Advertise Failing Behave Scenarios
if: failure()
run: |
pushd wildfly-builder-image
logFile=$(find . -type f -iname "test-logs-*.txt")
if [ -f "${logFile}" ]; then
# Remove tar noise
grep -v "tar.go:" ${logFile} > tmpFile && mv tmpFile ${logFile}
# Display failing scenario
grep -A10000 "Failing scenarios" ${logFile}
else
echo "No failure in behave tests"
fi
popd
- name: Upload Test Reports on Failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: wildfly-s2i-test-logs-${{ matrix.os }}-${{ matrix.jdk }}
path: |
wildfly-builder-image/test-logs-*.txt
/tmp/*.wfs2i.log
- name: Display resources information
if: failure()
run: |
echo === RUNNING CONTAINERS ===
docker container ls
echo === RUNNING PROCESSES ===
top -b -n1
echo === DISK USAGE ===
df -h