Skip to content

Commit 24c4406

Browse files
committed
Add test_images_report
1 parent 564392e commit 24c4406

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

.github/workflows/build-docker-artifacts.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
required: false
2626
default: true
2727
scan_high_severity:
28-
description: 'Include high severity'
28+
description: "Include high severity"
2929
type: boolean
3030
required: false
3131
default: true
@@ -45,7 +45,7 @@ concurrency:
4545
cancel-in-progress: true
4646

4747
env:
48-
WORKFLOW_BRANCH: "mp/test_images" # TODO: Revert to main
48+
WORKFLOW_BRANCH: "mp/test_images" # TODO: Revert to main
4949
DATAVISYN_PYTHON_BASE_IMAGE: "188237246440.dkr.ecr.eu-central-1.amazonaws.com/datavisyn/base/python:main"
5050
DATAVISYN_NGINX_BASE_IMAGE: "188237246440.dkr.ecr.eu-central-1.amazonaws.com/datavisyn/base/nginx:main"
5151

@@ -60,7 +60,7 @@ jobs:
6060
result: ${{ steps.get-flavors.outputs.result }}
6161
# Do not run this on self-hosted, as it is faster and shouldn't be blocking anything
6262
# runs-on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
63-
runs-on: 'ubuntu-22.04'
63+
runs-on: "ubuntu-22.04"
6464
steps:
6565
- name: Checkout repository
6666
uses: actions/checkout@v5
@@ -279,7 +279,7 @@ jobs:
279279
# ignore-unfixed: false
280280
# vuln-type: 'os,library'
281281
# severity: ${{ steps.set_severity.outputs.severity }}
282-
# continue-on-error: false
282+
# continue-on-error: false
283283

284284
# - name: Push image
285285
# if: ${{ inputs.skip_push != true }}
@@ -322,10 +322,17 @@ jobs:
322322
id: login-ecr
323323
uses: aws-actions/[email protected]
324324

325-
- name: Test images
325+
- name: Run test-images.sh hook
326326
shell: bash
327+
id: test-images
327328
run: |
328-
test_images_hook="./deploy/build/${{ matrix.flavor.directory }}/hooks/test_images.sh"
329+
hooks_folder="./deploy/build/${{ matrix.flavor.directory }}/hooks"
330+
test_images_hook="$hooks_folder/test-images.sh"
331+
test_images_report="$hooks_folder/test-images-report"
332+
333+
# Create report folder to avoid any downstream Docker volume issues
334+
mkdir -p "$test_images_report"
335+
chmod 777 "$test_images_report"
329336
330337
if [[ -f "$test_images_hook" ]]; then
331338
# Iterate through all components and store their image ref in an environment variable
@@ -341,12 +348,29 @@ jobs:
341348
echo "Run $test_images_hook"
342349
chmod +x "$test_images_hook"
343350
"$test_images_hook"
351+
352+
if [[ -d "$test_images_report" ]]; then
353+
# Store as output of this action, so we can upload it as artifact in the next step
354+
echo "Found $test_images_report, storing as output."
355+
ls -la ${hooks_folder}
356+
echo "test_images_report=$test_images_report" >> $GITHUB_OUTPUT
357+
else
358+
echo "No $test_images_report found."
359+
ls -la ${hooks_folder}
360+
fi
344361
else
345362
echo "No $test_images_hook found, skipping tests."
346363
fi
347364
env:
348365
FLAVOR: ${{ toJSON(matrix.flavor) }}
349366

367+
- name: Upload test-images-report
368+
uses: actions/upload-artifact@v4
369+
if: ${{ steps.test-images.outputs.test_images_report }}
370+
with:
371+
name: "test-images-report-${{ matrix.flavor.id || 'default' }}"
372+
path: ${{ steps.test-images.outputs.test_images_report }}
373+
350374
- name: Log out from Amazon ECR
351375
shell: bash
352376
run: docker logout ${{ steps.login-ecr.outputs.registry }}
@@ -361,7 +385,7 @@ jobs:
361385
flavor: ${{ fromJson(needs.get-flavors.outputs.result).flavors }}
362386
# Do not run this on self-hosted, as it is faster and shouldn't be blocking anything
363387
# runs-on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
364-
runs-on: 'ubuntu-22.04'
388+
runs-on: "ubuntu-22.04"
365389
steps:
366390
- name: Checkout repository
367391
uses: actions/checkout@v5

0 commit comments

Comments
 (0)