@@ -4,7 +4,13 @@ name: Integration Test
44on :
55 workflow_call :
66 inputs :
7- image-name :
7+ fully-qualified-image-name :
8+ required : true
9+ type : string
10+ image-basename :
11+ required : true
12+ type : string
13+ image-digest :
814 required : true
915 type : string
1016 test-file :
2834permissions : {}
2935
3036jobs :
31- sanitize-image-name :
32- uses : ./.github/workflows/wc-sanitize-image-name.yml
33- with :
34- image-name : ${{ inputs.image-name }}
35- registry : ${{ inputs.registry }}
36- runner-labels : ${{ inputs.runner-labels }}
37-
38- determine-container :
39- runs-on : ${{ (startsWith(inputs.runner-labels, '[') && endsWith(inputs.runner-labels, ']')) && fromJson(inputs.runner-labels) || inputs.runner-labels }}
40- needs : sanitize-image-name
41- outputs :
42- container : ${{ steps.set-container.outputs.container }}
43- runner-arch : ${{ steps.runner-arch.outputs.arch }}
44- steps :
45- - uses : step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
46- with :
47- disable-sudo : true
48- egress-policy : audit
49- - run : echo "arch=${RUNNER_ARCH@L}" >> "$GITHUB_OUTPUT"
50- id : runner-arch
51- - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
52- with :
53- path : ${{ runner.temp }}/digests-${{ needs.sanitize-image-name.outputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
54- pattern : digests-${{ needs.sanitize-image-name.outputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
55- - run : echo "container=$(printf "${FULLY_QUALIFIED_IMAGE_NAME}@sha256:%s " *)" >> "$GITHUB_OUTPUT"
56- working-directory : ${{ runner.temp }}/digests-${{ needs.sanitize-image-name.outputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
57- env :
58- FULLY_QUALIFIED_IMAGE_NAME : ${{ needs.sanitize-image-name.outputs.fully-qualified-image-name }}
59- GH_REPO : ${{ github.repository }}
60- id : set-container
61-
6237 run-test :
63- needs :
64- - determine-container
65- - sanitize-image-name
6638 runs-on : ${{ (startsWith(inputs.runner-labels, '[') && endsWith(inputs.runner-labels, ']')) && fromJson(inputs.runner-labels) || inputs.runner-labels }}
6739 container :
68- image : ${{ needs.determine-container.outputs.container }} # zizmor: ignore[unpinned-images] This image is actually pinned by sha256 digest
40+ image : ${{ inputs.fully-qualified-image-name }}@${{ inputs. image- digest }}
6941 credentials :
7042 username : ${{ secrets.DOCKER_REGISTRY_USERNAME || github.actor }}
7143 password : ${{ secrets.DOCKER_REGISTRY_PASSWORD || github.token }}
@@ -82,16 +54,16 @@ jobs:
8254 - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
8355 with :
8456 path : test/cpp/.xwin-cache
85- key : xwin-cache-${{ needs.determine-container.outputs. runner- arch }}
57+ key : xwin-cache-${{ runner. arch }}
8658 restore-keys : |
87- xwin-cache-${{ needs.determine-container.outputs. runner- arch }}
59+ xwin-cache-${{ runner. arch }}
8860 - run : bats --formatter junit "${TEST_FILE}" | tee "test-report-${IMAGE_BASENAME}-${RUNNER_ARCH}.xml"
8961 env :
90- IMAGE_BASENAME : ${{ needs.sanitize-image-name.outputs .image-basename }}
62+ IMAGE_BASENAME : ${{ inputs .image-basename }}
9163 TEST_FILE : ${{ inputs.test-file }}
92- RUNNER_ARCH : ${{ needs.determine-container.outputs. runner- arch }}
64+ RUNNER_ARCH : ${{ runner. arch }}
9365 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
9466 if : ${{ !cancelled() }}
9567 with :
96- name : test-results-integration-${{ needs.sanitize- image-name.outputs.image- basename }}-${{ needs.determine-container.outputs. runner- arch }}
68+ name : test-results-integration-${{ inputs. image-basename }}-${{ runner. arch }}
9769 path : test-report-*.xml
0 commit comments