@@ -4,25 +4,28 @@ name: Integration Test
44on :
55 workflow_call :
66 inputs :
7- flavor :
7+ fully-qualified-image-name :
8+ required : false
9+ type : string
10+ image-basename :
811 required : true
912 type : string
10- runner :
13+ test-file :
14+ required : true
15+ type : string
16+ runner-labels :
17+ description : " Runner to use for the job, will be passed to `runs-on`"
1118 required : true
1219 type : string
1320
14- permissions :
15- contents : read
16-
17- env :
18- CONTAINER_FLAVOR : ${{ inputs.flavor }}
19- RUNNER : ${{ inputs.runner }}
21+ permissions : {}
2022
2123jobs :
2224 determine-container :
23- runs-on : ${{ inputs.runner }}
25+ runs-on : ${{ inputs.runner-labels }}
2426 outputs :
2527 container : ${{ steps.set-container.outputs.container }}
28+ runner-arch : ${{ steps.runner-arch.outputs.arch }}
2629 steps :
2730 - uses : step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2831 with :
@@ -32,17 +35,21 @@ jobs:
3235 id : runner-arch
3336 - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
3437 with :
35- path : ${{ runner.temp }}/digests-${{ inputs.flavor }}-${{ steps.runner-arch.outputs.arch }}
36- pattern : digests-${{ inputs.flavor }}-${{ steps.runner-arch.outputs.arch }}
37- - run : echo "container=$(printf "ghcr.io/${GH_REPO}-${CONTAINER_FLAVOR }@sha256:%s " *)" >> "$GITHUB_OUTPUT"
38- working-directory : ${{ runner.temp }}/digests-${{ inputs.flavor }}-${{ steps.runner-arch.outputs.arch }}
38+ path : ${{ runner.temp }}/digests-${{ inputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
39+ pattern : digests-${{ inputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
40+ - run : echo "container=$(printf "${FULLY_QUALIFIED_IMAGE_NAME }@sha256:%s " *)" >> "$GITHUB_OUTPUT"
41+ working-directory : ${{ runner.temp }}/digests-${{ inputs.image-basename }}-${{ steps.runner-arch.outputs.arch }}
3942 env :
43+ FULLY_QUALIFIED_IMAGE_NAME : ${{ inputs.fully-qualified-image-name }}
4044 GH_REPO : ${{ github.repository }}
4145 id : set-container
46+
4247 run-test :
4348 needs : determine-container
44- runs-on : ${{ inputs.runner }}
49+ runs-on : ${{ inputs.runner-labels }}
4550 container : ${{ needs.determine-container.outputs.container }}
51+ permissions :
52+ contents : read
4653 steps :
4754 - uses : step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
4855 with :
@@ -52,15 +59,18 @@ jobs:
5259 with :
5360 persist-credentials : false
5461 - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
55- if : inputs.flavor == 'cpp'
5662 with :
5763 path : test/cpp/.xwin-cache
58- key : xwin-cache-${{ inputs. runner }}
64+ key : xwin-cache-${{ needs.determine-container.outputs. runner-arch }}
5965 restore-keys : |
60- xwin-cache
61- - run : bats --formatter junit "test/${CONTAINER_FLAVOR}/integration-tests.bats" | tee "test-report-${CONTAINER_FLAVOR}-${RUNNER}.xml"
66+ xwin-cache-${{ needs.determine-container.outputs.runner-arch }}
67+ - run : bats --formatter junit "${TEST_FILE}" | tee "test-report-${IMAGE_BASENAME}-${RUNNER_ARCH}.xml"
68+ env :
69+ IMAGE_BASENAME : ${{ inputs.image-basename }}
70+ TEST_FILE : ${{ inputs.test-file }}
71+ RUNNER_ARCH : ${{ needs.determine-container.outputs.runner-arch }}
6272 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6373 if : always()
6474 with :
65- name : test-results-integration-${{ inputs.flavor }}-${{ inputs. runner }}
75+ name : test-results-integration-${{ inputs.image-basename }}-${{ needs.determine-container.outputs. runner-arch }}
6676 path : test-report-*.xml
0 commit comments