@@ -4,12 +4,16 @@ name: Build, Push & Test
44on :
55 workflow_call :
66 inputs :
7+ acceptance-test-devcontainer-file :
8+ description : Path to the devcontainer.json file to use for acceptance tests.
9+ required : false
10+ type : string
711 acceptance-test-path :
8- description : Path to the Playwright acceptance tests (directory that contains playwright.config.ts)
12+ description : Path to the Playwright acceptance tests (directory that contains playwright.config.ts).
913 required : false
1014 type : string
1115 build-args :
12- description : Optional docker build args (newline-separated KEY=VALUE)
16+ description : Optional docker build args (newline-separated KEY=VALUE).
1317 required : false
1418 type : string
1519 build-test-runner-labels :
3842 required : true
3943 type : string
4044 enable-edge-tag :
41- description : Whether to also build and push an "edge" tag for the image
45+ description : Whether to also build and push an "edge" tag for the image.
4246 required : false
4347 type : boolean
4448 default : false
5256 required : true
5357 type : string
5458 integration-test-file :
55- description : Path to the BATS test file to run for integration tests
59+ description : Path to the BATS test file to run for integration tests.
5660 required : false
5761 type : string
62+ integration-test-podman :
63+ description : Enable running the tests using the Podman container runtime, next to the default Docker container runtime.
64+ required : false
65+ type : boolean
66+ default : false
5867 registry :
5968 description : >-
6069 Docker registry to push built containers to.
7382 required : false
7483 type : string
7584 default : ' ["ubuntu-latest"]'
76- test-devcontainer-file :
77- description : Path to the devcontainer.json file to use for acceptance tests
78- required : false
79- type : string
8085 outputs :
8186 digest :
8287 value : ${{ jobs.build-push.outputs.digest }}
8893 value : ${{ jobs.build-push.outputs.version }}
8994 secrets :
9095 DOCKER_REGISTRY_PASSWORD :
91- description : Password or token for Docker login, if not provided the GitHub token will be used
96+ description : Password or token for Docker login, if not provided the GitHub token will be used.
9297 required : false
9398 DOCKER_REGISTRY_USERNAME :
94- description : User name for Docker login, if not provided the GitHub actor will be used
99+ description : User name for Docker login, if not provided the GitHub actor will be used.
95100 required : false
96101 TEST_GITHUB_PASSWORD :
97102 required : false
@@ -116,7 +121,7 @@ jobs:
116121 id-token : write # is needed by actions/attest-build-provenance to obtain an OIDC token
117122 packages : write # is needed to push image manifest when using GitHub Container Registry
118123 pull-requests : write # is needed by marocchino/sticky-pull-request-comment to post comments
119- secrets :
124+ secrets : &docker-secrets
120125 DOCKER_REGISTRY_USERNAME : ${{ secrets.DOCKER_REGISTRY_USERNAME }}
121126 DOCKER_REGISTRY_PASSWORD : ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
122127 with :
@@ -129,17 +134,15 @@ jobs:
129134 runner-labels : ${{ inputs.runner-labels }}
130135 build-test-runner-labels : ${{ inputs.build-test-runner-labels }}
131136
132- integration-test :
137+ integration-test-docker :
133138 name : 🧪
134139 if : ${{ inputs.integration-test-file }}
135140 needs : build-push
136- uses : ./.github/workflows/wc-integration-test.yml
141+ uses : ./.github/workflows/wc-integration-test-docker .yml
137142 permissions :
138143 contents : read
139- secrets :
140- DOCKER_REGISTRY_USERNAME : ${{ secrets.DOCKER_REGISTRY_USERNAME }}
141- DOCKER_REGISTRY_PASSWORD : ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
142- with :
144+ secrets : *docker-secrets
145+ with : &integration-test-inputs
143146 build-test-runner-labels : ${{ inputs.build-test-runner-labels }}
144147 fully-qualified-image-name : ${{ needs.build-push.outputs.fully-qualified-image-name }}
145148 image-basename : ${{ needs.build-push.outputs.image-basename }}
@@ -149,25 +152,17 @@ jobs:
149152
150153 integration-test-podman :
151154 name : 🧪
152- if : ${{ inputs.integration-test-file }}
155+ if : ${{ inputs.integration-test-file && inputs.integration-test-podman }}
153156 needs : build-push
154157 uses : ./.github/workflows/wc-integration-test-podman.yml
155158 permissions :
156159 contents : read
157- secrets :
158- DOCKER_REGISTRY_USERNAME : ${{ secrets.DOCKER_REGISTRY_USERNAME }}
159- DOCKER_REGISTRY_PASSWORD : ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
160- with :
161- build-test-runner-labels : ${{ inputs.build-test-runner-labels }}
162- fully-qualified-image-name : ${{ needs.build-push.outputs.fully-qualified-image-name }}
163- image-basename : ${{ needs.build-push.outputs.image-basename }}
164- image-digest : ${{ needs.build-push.outputs.digest }}
165- registry : ${{ inputs.registry }}
166- test-file : ${{ inputs.integration-test-file }}
160+ secrets : *docker-secrets
161+ with : *integration-test-inputs
167162
168163 acceptance-test :
169164 name : 🏗️
170- if : ${{ inputs.test-devcontainer-file && inputs.acceptance-test-path }}
165+ if : ${{ inputs.acceptance- test-devcontainer-file && inputs.acceptance-test-path }}
171166 needs : build-push
172167 uses : ./.github/workflows/wc-acceptance-test.yml
173168 permissions :
@@ -179,5 +174,5 @@ jobs:
179174 TEST_GITHUB_TOTP_SECRET : ${{ secrets.TEST_GITHUB_TOTP_SECRET }}
180175 with :
181176 image-basename : ${{ needs.build-push.outputs.image-basename }}
182- devcontainer-file : ${{ inputs.test-devcontainer-file }}
177+ devcontainer-file : ${{ inputs.acceptance- test-devcontainer-file }}
183178 acceptance-test-path : ${{ inputs.acceptance-test-path }}
0 commit comments