Skip to content

Commit 881383b

Browse files
committed
ci: gate manual docker builds with local checks
1 parent f869403 commit 881383b

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,28 @@ on:
1717
default: "true"
1818

1919
jobs:
20+
validate:
21+
name: Validate manual container gates
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 30
24+
permissions:
25+
contents: read
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions/setup-go@v5
30+
with:
31+
go-version-file: go.mod
32+
cache: true
33+
cache-dependency-path: |
34+
go.mod
35+
go.sum
36+
37+
- name: Run manual container gates
38+
run: ./scripts/ci.sh workflow-lint hygiene release-hygiene container-hygiene tidy test
39+
2040
build:
41+
needs: validate
2142
runs-on: ubuntu-latest
2243
permissions:
2344
contents: read

scripts/ci.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ container_hygiene() {
160160
printf 'docker publish build job must depend on validate\n' >&2
161161
return 1
162162
fi
163+
if ! git grep -nF 'name: Validate manual container gates' -- "$build" >/dev/null; then
164+
printf 'manual docker build workflow must validate repository gates before building images\n' >&2
165+
return 1
166+
fi
167+
if ! git grep -nF './scripts/ci.sh workflow-lint hygiene release-hygiene container-hygiene tidy test' -- "$build" >/dev/null; then
168+
printf 'manual docker build validate job must run local release gates\n' >&2
169+
return 1
170+
fi
171+
if ! git grep -nF 'needs: validate' -- "$build" >/dev/null; then
172+
printf 'manual docker build job must depend on validate\n' >&2
173+
return 1
174+
fi
163175
if ! git grep -nF 'image: ${VOHIVE_IMAGE:-ghcr.io/boa-z/vohive:latest}' -- "$compose" >/dev/null; then
164176
printf 'prebuilt compose file must default to the current GHCR image\n' >&2
165177
return 1

0 commit comments

Comments
 (0)