Skip to content

Commit

Permalink
ci(buildkit): set timeout to image job
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Dec 14, 2023
1 parent a960fe5 commit 8fb1a8c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/buildkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
IMAGE_NAME: "moby/buildkit"
PLATFORMS: "linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le,linux/riscv64"
DESTDIR: "./bin"
BUILD_TIMEOUT: "900" # 15 minutes

jobs:
prepare:
Expand Down Expand Up @@ -160,6 +161,7 @@ jobs:
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
Expand All @@ -175,8 +177,14 @@ jobs:
-
name: Build ${{ needs.prepare.outputs.tag }}
run: |
./hack/images "${{ needs.prepare.outputs.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
timeout ${BUILD_TIMEOUT} ./hack/images "${{ needs.prepare.outputs.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
if [ $? -eq 124 ]; then
echo "::error::Build timed out after ${BUILD_TIMEOUT} seconds"
docker kill --signal=SIGTERM buildx_buildkit_${{ steps.buildx.outputs.name }}
exit 1
fi
env:
BUILDX_CMD: docker --debug buildx
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
TARGET: ${{ matrix.target-stage }}
CACHE_FROM: type=gha,scope=image${{ matrix.target-stage }}
Expand Down

0 comments on commit 8fb1a8c

Please sign in to comment.