diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 84ebcf5d33..e4a89c1256 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -47,3 +47,28 @@ jobs: push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} + + - name: build image for tests + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + platforms: linux/amd64 + load: true + tags: ${{ steps.docker_meta.outputs.tags }} + + - name: run integration test + shell: bash + run: | + IMAGE=$(echo "${{ steps.docker_meta.outputs.tags }}" | head -n 1) + docker run -d --name sonos-test -p 5005:5005 "$IMAGE" + for i in {1..20}; do + if curl -fs http://localhost:5005/zones > /dev/null; then + success=true + break + fi + sleep 3 + done + docker rm -f sonos-test + if [ "$success" != "true" ]; then + echo "Endpoint test failed" >&2 + exit 1 + fi