From be351bbb7d53f42e2bdb1ff48b8a499f3735cc37 Mon Sep 17 00:00:00 2001 From: wispem-wantex Date: Sat, 8 Nov 2025 23:05:38 -0800 Subject: [PATCH] Add cheating bootstrap CI container, with gocheckout pre-installed --- .gitea/workflows/CI.yaml | 28 +++++++++++++++++++++++++--- ops/devcontainer/Dockerfile | 1 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/CI.yaml b/.gitea/workflows/CI.yaml index 5b6d1df..fcf24a3 100644 --- a/.gitea/workflows/CI.yaml +++ b/.gitea/workflows/CI.yaml @@ -3,10 +3,32 @@ name: CI on: [push] jobs: - # This step builds the `gas/ci` docker image. - # There's a tricky bootstrapping problem here. Let's use Alpine and install `gocheckout` first - # thing. + # These steps build the `gas/ci` docker image. + # There's a tricky bootstrapping problem here. We'll try to cheat first, and if that doesn't + # work, then we'll do a full bootstrapping build starting from Alpine and installing `gocheckout` + # first thing. build-docker: + container: + image: gas/ci + volumes: + - woodpecker-gocache:/go-cache-volume + env: + GOPATH: /go-cache-volume + GOCACHE: /go-cache-volume/build-cache + steps: + - name: checkout + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gocheckout + + - name: build CI container + run: docker build -t gas/ci ops/devcontainer + + # Fallback: full bootstrap build. This one is quite slow. + build-docker-bootstrap: + needs: build-docker + if: ${{ needs.build-docker.result == "failure" }} + container: image: alpine:3.22 volumes: diff --git a/ops/devcontainer/Dockerfile b/ops/devcontainer/Dockerfile index dabb5d2..6acb9ab 100644 --- a/ops/devcontainer/Dockerfile +++ b/ops/devcontainer/Dockerfile @@ -3,6 +3,7 @@ FROM alpine:3.22 RUN apk add build-base git go sqlite shellcheck curl jq +RUN apk add docker RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v2.0.2 RUN GOBIN=/usr/local/bin go install git.offline-twitter.com/offline-labs/gocheckout@v0.0.2