ci: gate admin-web docker build on unit tests and remove admin-web job from ci.yml
- admin-web-docker.yml: add 'test' job (Node 22, npm ci, tsc --noEmit, vitest run) gated by the anti-[skip ci] guard, wire needs: [test] on build-validation and semantic-release, and needs: [semantic-release, test] on build-and-push. Tests now run as a gate before Docker build validation on PRs and before semantic-release on main. - ci.yml: drop the redundant admin-web-test job (now covered by the test job in admin-web-docker.yml on PRs), remove the admin-web path filter and output from the changes job, simplify deploy-functions.needs. - scripts/verify-admin-web-docker.sh: update check_workflow_jobs to expect 4 jobs (test + build-validation + semantic-release + build-and-push) and check_workflow_needs to expect build-and-push needs [semantic-release, test] so the verify script stays green with the new job topology.
This commit is contained in:
@@ -263,9 +263,9 @@ check_workflow_valid() {
|
||||
yaml_valid ".github/workflows/admin-web-docker.yml" "admin-web-docker.yml is valid YAML"
|
||||
}
|
||||
|
||||
# --- workflow: exactly 3 jobs --------------------------------------- #
|
||||
# --- workflow: exactly 4 jobs --------------------------------------- #
|
||||
check_workflow_jobs() {
|
||||
local label="workflow has exactly 3 jobs: build-validation + semantic-release + build-and-push"
|
||||
local label="workflow has exactly 4 jobs: test + build-validation + semantic-release + build-and-push"
|
||||
local f=".github/workflows/admin-web-docker.yml"
|
||||
if [[ ! -f "$f" ]]; then
|
||||
fail "$label" "file missing"
|
||||
@@ -281,16 +281,16 @@ print(','.join(sorted(jobs)))
|
||||
fail "$label" "could not parse jobs"
|
||||
return
|
||||
fi
|
||||
if [[ "$out" == "build-and-push,build-validation,semantic-release" ]]; then
|
||||
if [[ "$out" == "build-and-push,build-validation,semantic-release,test" ]]; then
|
||||
pass "$label"
|
||||
else
|
||||
fail "$label" "jobs=[$out]"
|
||||
fi
|
||||
}
|
||||
|
||||
# --- workflow: build-and-push needs semantic-release --------------- #
|
||||
# --- workflow: build-and-push needs semantic-release + test ---------- #
|
||||
check_workflow_needs() {
|
||||
local label="build-and-push needs: semantic-release"
|
||||
local label="build-and-push needs: [semantic-release, test]"
|
||||
local f=".github/workflows/admin-web-docker.yml"
|
||||
if [[ ! -f "$f" ]]; then
|
||||
fail "$label" "file missing"
|
||||
@@ -305,7 +305,7 @@ n=bp.get('needs')
|
||||
if isinstance(n,list): print(','.join(n))
|
||||
else: print(str(n))
|
||||
" "$f" 2>/dev/null || true)
|
||||
if [[ "$out" == "semantic-release" ]]; then
|
||||
if [[ "$out" == "semantic-release,test" ]]; then
|
||||
pass "$label"
|
||||
else
|
||||
fail "$label" "needs='$out'"
|
||||
|
||||
Reference in New Issue
Block a user