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:
Millian Lamiaux
2026-07-13 15:44:52 +02:00
committed by millianlmx
parent 094bd59470
commit 8236eb35ae
3 changed files with 36 additions and 46 deletions

View File

@@ -17,8 +17,35 @@ env:
NODE_VERSION: "22"
jobs:
test:
name: Admin Web Tests
runs-on: ubuntu-latest
timeout-minutes: 10
if: |
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.head_commit.message, '[ci skip]')
defaults:
run:
working-directory: admin-web
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: admin-web/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npx tsc --noEmit
- name: Run unit tests
run: npx vitest run
build-validation:
name: Docker Build Validation
needs: [test]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 15
@@ -47,6 +74,7 @@ jobs:
semantic-release:
name: Semantic Release
needs: [test]
runs-on: ubuntu-latest
timeout-minutes: 10
if: |
@@ -100,7 +128,7 @@ jobs:
build-and-push:
name: Build & Push Docker Image
needs: semantic-release
needs: [semantic-release, test]
runs-on: ubuntu-latest
timeout-minutes: 15
if: |

View File

@@ -12,7 +12,6 @@ jobs:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
admin-web: ${{ steps.filter.outputs.admin-web }}
youtube-worker: ${{ steps.filter.outputs.youtube-worker }}
supabase-functions: ${{ steps.filter.outputs.supabase-functions }}
steps:
@@ -22,9 +21,6 @@ jobs:
id: filter
with:
filters: |
admin-web:
- 'admin-web/**'
- '.github/workflows/ci.yml'
youtube-worker:
- 'youtube-worker/**'
- '.github/workflows/ci.yml'
@@ -33,40 +29,6 @@ jobs:
- 'youtube-worker/**'
- '.github/workflows/ci.yml'
# ── Admin Web: Next.js ──
admin-web-test:
name: Admin Web CI
needs: changes
if: needs.changes.outputs.admin-web == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: admin-web
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: admin-web/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npx tsc --noEmit
- name: Run unit tests
run: npx vitest run
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run E2E tests
run: npx playwright test
# ── YouTube Worker: Node.js microservice ──
youtube-worker-check:
name: YouTube Worker
@@ -95,7 +57,7 @@ jobs:
# ── Deploy: Supabase edge functions + YouTube worker ──
deploy-functions:
name: Deploy
needs: [changes, admin-web-test, youtube-worker-check]
needs: [changes, youtube-worker-check]
if: |
always() &&
github.ref == 'refs/heads/main' &&