Skip to content

Commit 1a4c73a

Browse files
committed
chore: Enhanced testing
1 parent 08e8e68 commit 1a4c73a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/build-image-test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,30 @@ jobs:
128128
provenance: false
129129
secrets: |
130130
"github_token=${{ secrets.GITHUB_TOKEN }}"
131+
132+
# Build tools image using Dockerfile.tools and the just-built main image as base
133+
- name: Build tools image
134+
if: steps.changed-files-specific.outputs.any_changed == 'true'
135+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
136+
with:
137+
context: .
138+
file: ./Dockerfile.tools
139+
build-args: |
140+
BASE_IMAGE=${{ env.IMAGE }}
141+
push: false
142+
load: true
143+
tags: ${{ env.IMAGE }}-tools
144+
provenance: false
145+
secrets: |
146+
"github_token=${{ secrets.GITHUB_TOKEN }}"
147+
148+
# Smoke test the tools image
149+
- name: Smoke test tools image
150+
if: steps.changed-files-specific.outputs.any_changed == 'true'
151+
env:
152+
TOOLS_IMAGE: ${{ env.IMAGE }}-tools
153+
run: |
154+
echo "Testing tools image: $TOOLS_IMAGE"
155+
docker run --rm "$TOOLS_IMAGE" terraform --version
156+
docker run --rm "$TOOLS_IMAGE" terraform-docs --version
157+
docker run --rm "$TOOLS_IMAGE" tflint --version

0 commit comments

Comments
 (0)