Skip to content

Commit 6d20a73

Browse files
authored
ci(cryostat3): build and test against cryostat 3.0 (#353)
* ci(cryostat3): build and test against cryostat 3.0 * run unit and integration tests on initial build * simplify for single-arch build
1 parent 0aef13e commit 6d20a73

File tree

2 files changed

+13
-284
lines changed

2 files changed

+13
-284
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -56,62 +56,10 @@ jobs:
5656
- run: mvn -B -U clean install
5757

5858
build-cryostat:
59-
needs: [build-core]
60-
strategy:
61-
matrix:
62-
arch: [amd64, arm64]
63-
runs-on: ubuntu-latest
64-
steps:
65-
- name: Install qemu
66-
if: ${{ matrix.arch != 'amd64' }}
67-
continue-on-error: true
68-
run: |
69-
sudo apt-get update
70-
sudo apt-get install -y qemu-user-static
71-
- uses: actions/checkout@v4
72-
with:
73-
repository: ${{ github.event.pull_request.head.repo.full_name }}
74-
ref: ${{ github.event.pull_request.head.ref }}
75-
fetch-depth: 0
76-
- uses: actions/cache@v3
77-
with:
78-
path: ~/.m2
79-
key: ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }}
80-
restore-keys: |
81-
${{ runner.os }}-build-
82-
${{ runner.os }}-
83-
- uses: actions/checkout@v4
84-
with:
85-
repository: ${{ github.repository_owner }}/cryostat
86-
ref: main
87-
submodules: true
88-
fetch-depth: 0
89-
- uses: actions/setup-java@v3
90-
with:
91-
java-version: '17'
92-
distribution: 'temurin'
93-
- name: maven-settings
94-
uses: s4u/maven-settings-action@v2
95-
with:
96-
githubServer: true
97-
- run: git submodule init
98-
- run: git submodule update
99-
- run: mvn -B -U -Dbuild.arch=${{ matrix.arch}} -Dio.cryostat.core.version=${{ needs.build-core.outputs.core_version }} clean package
100-
env:
101-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102-
- name: Save cryostat image
103-
run: podman save -o cryostat-${{ matrix.arch }}.tar --format oci-archive quay.io/cryostat/cryostat
104-
- uses: actions/upload-artifact@v3
105-
with:
106-
name: cryostat-${{ matrix.arch }}
107-
path: ${{ github.workspace }}/cryostat-${{ matrix.arch }}.tar
108-
109-
build-cryostat3:
11059
needs: [build-core]
11160
runs-on: ubuntu-latest
11261
strategy:
11362
matrix:
114-
arch: [amd64, arm64]
11563
java: ['17']
11664
env:
11765
cache-name: cache-yarn
@@ -182,107 +130,58 @@ jobs:
182130
- name: Set DOCKER_HOST environment variable
183131
run: echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV"
184132
- name: Build cryostat3
185-
run: ./mvnw -B -U -Dbuild.arch=${{ matrix.arch }} -Dio.cryostat.core.version=${{ needs.build-core.outputs.core_version }} clean package
133+
run: ./mvnw -B -U -Dio.cryostat.core.version=${{ needs.build-core.outputs.core_version }} clean verify
186134
continue-on-error: ${{ matrix.java != '17' }}
187135
env:
188136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189137
- name: Debug podman images
190138
run: podman images
191139
- name: Save cryostat3 image
192-
run: podman save -o cryostat3-${{ matrix.arch }}.tar --format oci-archive quay.io/cryostat/cryostat:3.0.0-snapshot
140+
run: podman save -o cryostat3.tar --format oci-archive quay.io/cryostat/cryostat:3.0.0-snapshot
193141
- uses: actions/upload-artifact@v3
194142
with:
195-
name: cryostat3-${{ matrix.arch }}
196-
path: ${{ github.workspace }}/cryostat3-${{ matrix.arch }}.tar
143+
name: cryostat3
144+
path: ${{ github.workspace }}/cryostat3.tar
197145

198146
push-to-ghcr:
199147
runs-on: ubuntu-latest
200148
needs: [build-cryostat]
201149
strategy:
202150
matrix:
203-
arch: [amd64, arm64]
204-
outputs:
205-
amd64_image: ${{ steps.amd64_image.outputs.image }}
206-
arm64_image: ${{ steps.arm64_image.outputs.image }}
207-
permissions:
208-
packages: write
209-
steps:
210-
- name: Download cryostat artifact
211-
uses: actions/download-artifact@v3
212-
with:
213-
name: cryostat-${{ matrix.arch }}
214-
- name: Load cryostat image
215-
run: podman load -i cryostat-${{ matrix.arch }}.tar
216-
- name: Tag cryostat image
217-
run: podman tag cryostat ghcr.io/${{ github.repository_owner }}/cryostat-core:pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-${{ matrix.arch }}
218-
- name: Push PR test image to ghcr.io
219-
id: push-to-ghcr
220-
uses: redhat-actions/push-to-registry@v2
221-
with:
222-
image: cryostat-core
223-
tags: pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-${{ matrix.arch }}
224-
registry: ghcr.io/${{ github.repository_owner }}
225-
username: ${{ github.event.pull_request.user.login }}
226-
password: ${{ secrets.GITHUB_TOKEN }}
227-
- name: Store images as output amd64
228-
if: ${{ matrix.arch == 'amd64' }}
229-
id: amd64_image
230-
run: echo "image=${{ steps.push-to-ghcr.outputs.registry-path }}" >> "$GITHUB_OUTPUT"
231-
- name: Store images as output
232-
if: ${{ matrix.arch == 'arm64' }}
233-
id: arm64_image
234-
run: echo "image=${{ steps.push-to-ghcr.outputs.registry-path }}" >> "$GITHUB_OUTPUT"
235-
236-
push-cryostat3-to-ghcr:
237-
runs-on: ubuntu-latest
238-
needs: [build-cryostat3]
239-
strategy:
240-
matrix:
241-
arch: [amd64, arm64]
242151
java: ['17']
243152
outputs:
244-
cryostat3_java17_amd64_image: ${{ steps.cryostat3_java17_amd64_image.outputs.image }}
245-
cryostat3_java17_arm64_image: ${{ steps.cryostat3_java17_arm64_image.outputs.image }}
153+
amd64_image: ${{ steps.cryostat3_amd64_image.outputs.image }}
246154

247155
permissions:
248156
packages: write
249157
steps:
250158
- name: Download cryostat3 artifact
251159
uses: actions/download-artifact@v3
252160
with:
253-
name: cryostat3-${{ matrix.arch }}
161+
name: cryostat3
254162
- name: Load cryostat3 image
255-
run: podman load -i cryostat3-${{ matrix.arch }}.tar
163+
run: podman load -i cryostat3.tar
256164
- name: Tag cryostat3 image
257-
run: podman tag cryostat:3.0.0-snapshot ghcr.io/${{ github.repository_owner }}/cryostat-core:pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-${{ matrix.arch }}-java${{ matrix.java }}
165+
run: podman tag cryostat:3.0.0-snapshot ghcr.io/${{ github.repository_owner }}/cryostat-core:pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-java${{ matrix.java }}
258166
- name: Push PR test image to ghcr.io
259167
id: push-cryostat3-to-ghcr
260168
uses: redhat-actions/push-to-registry@v2
261169
with:
262170
image: cryostat-core
263-
tags: pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-${{ matrix.arch }}-java${{ matrix.java }}
171+
tags: pr-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-linux-java${{ matrix.java }}
264172
registry: ghcr.io/${{ github.repository_owner }}
265173
username: ${{ github.event.pull_request.user.login }}
266174
password: ${{ secrets.GITHUB_TOKEN }}
267175
- name: store cryostat3 images as output
268-
if: ${{ matrix.arch == 'amd64' && matrix.java == '17' }}
269-
id: cryostat3_java17_amd64_image
270-
run: echo "image=${{ steps.push-cryostat3-to-ghcr.outputs.registry-path }}" >> "$GITHUB_OUTPUT"
271-
- name: store cryostat3 images as output
272-
if: ${{ matrix.arch == 'arm64' && matrix.java == '17' }}
273-
id: cryostat3_java17_arm64_image
176+
id: cryostat3_amd64_image
274177
run: echo "image=${{ steps.push-cryostat3-to-ghcr.outputs.registry-path }}" >> "$GITHUB_OUTPUT"
275-
276178

277179
comment-image:
278180
runs-on: ubuntu-latest
279-
needs: [push-to-ghcr, push-cryostat3-to-ghcr]
181+
needs: [push-to-ghcr]
280182
env:
281183
amd64_image: ${{ needs.push-to-ghcr.outputs.amd64_image }}
282-
arm64_image: ${{ needs.push-to-ghcr.outputs.arm64_image }}
283-
cryostat3_java17_amd64_image: ${{needs.push-cryostat3-to-ghcr.outputs.cryostat3_java17_amd64_image}}
284-
cryostat3_java17_arm64_image: ${{ needs.push-cryostat3-to-ghcr.outputs.cryostat3_java17_arm64_image }}
285-
184+
286185
permissions:
287186
pull-requests: write
288187
steps:
@@ -293,9 +192,6 @@ jobs:
293192
csvinput: |
294193
ARCH, IMAGE
295194
amd64, ${{ env.amd64_image }}
296-
arm64, ${{ env.arm64_image }}
297-
cryostat3-java17_amd64, ${{ env.cryostat3_java17_amd64_image }}
298-
cryostat3-java17_arm64, ${{ env.cryostat3_java17_arm64_image }}
299195
300196
- uses: thollander/actions-comment-pull-request@v2
301197
with:
@@ -304,15 +200,5 @@ jobs:
304200
305201
To run smoketest:
306202
```
307-
# amd64
308-
CRYOSTAT_IMAGE=${{ env.amd64_image }} sh smoketest.sh
309-
310-
# or arm64
311-
CRYOSTAT_IMAGE=${{ env.arm64_image }} sh smoketest.sh
312-
313-
# or cryostat3-java17-amd64
314-
CRYOSTAT3_java17amd64_IMAGE=${{ env.cryostat3_java17_amd64_image }} sh smoketest.sh
315-
316-
# or cryostat3-java17-arm64
317-
CRYOSTAT3_java17arm64_IMAGE=${{ env.cryostat3_java17_arm64_image }} sh smoketest.sh
203+
CRYOSTAT_IMAGE=${{ env.amd64_image }} bash smoketest.bash
318204
```

.github/workflows/cryostat-test.yml

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)