Skip to content

Commit f1ec78f

Browse files
committed
Add integration test for Docker image
1 parent b492282 commit f1ec78f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/docker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,28 @@ jobs:
4646
push: ${{ github.ref == 'refs/heads/master' }}
4747
tags: ${{ steps.docker_meta.outputs.tags }}
4848
labels: ${{ steps.docker_meta.outputs.labels }}
49+
50+
- name: build image for tests
51+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
52+
with:
53+
platforms: linux/amd64
54+
load: true
55+
tags: ${{ steps.docker_meta.outputs.tags }}
56+
57+
- name: run integration test
58+
shell: bash
59+
run: |
60+
IMAGE=$(echo "${{ steps.docker_meta.outputs.tags }}" | head -n 1)
61+
docker run -d --name sonos-test -p 5005:5005 "$IMAGE"
62+
for i in {1..20}; do
63+
if curl -fs http://localhost:5005/zones > /dev/null; then
64+
success=true
65+
break
66+
fi
67+
sleep 3
68+
done
69+
docker rm -f sonos-test
70+
if [ "$success" != "true" ]; then
71+
echo "Endpoint test failed" >&2
72+
exit 1
73+
fi

0 commit comments

Comments
 (0)