@@ -148,6 +148,51 @@ jobs:
148
148
labels : ${{ steps.meta.outputs.labels }}
149
149
outputs : type=image,name=target,annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }}
150
150
151
+ test :
152
+ needs : [changes]
153
+ if : needs.changes.outputs.should-run-build == 'true'
154
+ name : Test Image With Goss
155
+ runs-on : ubuntu-22.04
156
+ strategy :
157
+ matrix :
158
+ image_type : [alpine, debian]
159
+ env :
160
+ # Set docker repo to either the fork or the main repo where the branch exists
161
+ DOCKER_REPO : ghcr.io/${{ github.repository }}
162
+
163
+ steps :
164
+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
165
+
166
+ - name : Set up Docker Buildx
167
+ uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
168
+ # https://github.com/docker/build-push-action/issues/761#issuecomment-1575006515
169
+ with :
170
+ driver-opts : |
171
+ image=moby/buildkit:v0.13.2
172
+
173
+ - name : " Build and load into Docker"
174
+ if : contains(fromJson('["push", "pull_request"]'), github.event_name)
175
+ uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
176
+ with :
177
+ cache-from : type=gha
178
+ cache-to : type=gha,mode=max
179
+ context : .
180
+ build-args : |
181
+ ATLANTIS_BASE_TAG_TYPE=${{ matrix.image_type }}
182
+ push : false
183
+ load : true
184
+ tags : " ${{ env.DOCKER_REPO }}:goss-test"
185
+ target : ${{ matrix.image_type }}
186
+
187
+ - name : " Setup Goss"
188
+ uses : e1himself/goss-installation-action@fbb6fb55d3e59c96045b2500eeb8ce0995d99ac1 # v1.2.1
189
+ with :
190
+ version : " v0.4.7"
191
+
192
+ - name : Execute Goss tests
193
+ run : |
194
+ dgoss run --rm ${{ env.DOCKER_REPO }}:goss-test bash -c 'while true; do sleep 1; done;'
195
+
151
196
skip-build :
152
197
needs : [changes]
153
198
if : needs.changes.outputs.should-run-build == 'false'
0 commit comments