diff --git a/.gitea/workflows/quality-gates.yml b/.gitea/workflows/quality-gates.yml index 20d19234..8483eb6d 100644 --- a/.gitea/workflows/quality-gates.yml +++ b/.gitea/workflows/quality-gates.yml @@ -31,31 +31,97 @@ env: CI_RUNNER_IMAGE: "${{ vars.RUNNER_IMAGE_DIGEST }}" jobs: - merge_gate: - name: "${{ matrix.gate }} / ${{ matrix.name }}" + merge_static: + name: "merge / static checks" + if: ${{ gitea.event_name != 'workflow_dispatch' || inputs.stage != 'documentation' }} + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + - uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + - name: Frozen install + run: | + corepack enable + corepack pnpm install --frozen-lockfile --ignore-scripts + - name: "FE-GATE-001 / manifest-lockfile" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-001 + - name: "FE-GATE-002 / lint" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-002 + - name: "FE-GATE-003 / typecheck" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-003 + - name: "FE-GATE-010 / architecture" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-010 + - name: "FE-GATE-011 / build" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-011 + - name: "FE-GATE-012 / bundle" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-012 + - name: Upload merge static evidence + if: always() + uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 + with: + name: "merge-static-${{ gitea.run_id }}" + path: artifacts/ + if-no-files-found: error + + merge_test: + name: "merge / tests" if: ${{ gitea.event_name != 'workflow_dispatch' || inputs.stage != 'documentation' }} # FE-GATE-013 runner requirement: Linux with executable /usr/bin/bwrap (with --size), /usr/bin/prlimit, /usr/bin/systemd-run, /usr/bin/systemctl and /usr/bin/tar, an active systemd user manager 254 or newer, and unified cgroup v2 with delegated memory, pids and cpu controllers # FE-GATE-013 runner requirement: unprivileged user and network namespaces for bwrap (the provider sandbox runs bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-net); Ubuntu 23.10 and later refuse them while kernel.apparmor_restrict_unprivileged_userns=1 unless /usr/bin/bwrap has an AppArmor profile that allows userns; scripts/check-system-test-prerequisites.ts probes this before test:system runs runs-on: ubuntu-latest timeout-minutes: 45 - strategy: - fail-fast: false - matrix: - include: - - { gate: FE-GATE-001, name: manifest-lockfile, browser: false } - - { gate: FE-GATE-002, name: lint, browser: false } - - { gate: FE-GATE-003, name: typecheck, browser: false } - - { gate: FE-GATE-004, name: runtime-schema, browser: false } - - { gate: FE-GATE-005, name: unit, browser: false } - - { gate: FE-GATE-006, name: component, browser: false } - - { gate: FE-GATE-007, name: integration, browser: false } - - { gate: FE-GATE-008, name: e2e, browser: true } - - { gate: FE-GATE-009, name: accessibility, browser: true } - - { gate: FE-GATE-010, name: architecture, browser: false } - - { gate: FE-GATE-011, name: build, browser: false } - - { gate: FE-GATE-012, name: bundle, browser: false } - - { gate: FE-GATE-013, name: security, browser: false } - - { gate: FE-GATE-020, name: removability, browser: false } + steps: + - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + - uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + - name: Frozen install + run: | + corepack enable + corepack pnpm install --frozen-lockfile --ignore-scripts + - name: "FE-GATE-004 / runtime-schema" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-004 + - name: "FE-GATE-005 / unit" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-005 + - name: "FE-GATE-006 / component" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-006 + - name: "FE-GATE-007 / integration" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-007 + - name: "FE-GATE-013 / security" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-013 + - name: "FE-GATE-020 / removability" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-020 + - name: Upload merge test evidence + if: always() + uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 + with: + name: "merge-test-${{ gitea.run_id }}" + path: artifacts/ + if-no-files-found: error + + merge_browser: + name: "merge / browser tests" + if: ${{ gitea.event_name != 'workflow_dispatch' || inputs.stage != 'documentation' }} + runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: @@ -68,23 +134,26 @@ jobs: corepack enable corepack pnpm install --frozen-lockfile --ignore-scripts - name: Install Playwright browsers - if: ${{ matrix.browser }} run: | corepack pnpm exec playwright install --with-deps chromium firefox webkit $(command -v sudo || true) apt-get install -y fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation - - name: Run blocking gate - run: corepack pnpm ci:gate -- ${{ matrix.gate }} - - name: Upload merge gate evidence + - name: "FE-GATE-008 / e2e" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-008 + - name: "FE-GATE-009 / accessibility" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-009 + - name: Upload merge browser evidence if: always() uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 with: - name: "${{ matrix.gate }}-${{ gitea.run_id }}" + name: "merge-browser-${{ gitea.run_id }}" path: artifacts/ if-no-files-found: error release_gate: name: "${{ matrix.gate }} / ${{ matrix.name }}" - needs: merge_gate + needs: [merge_static, merge_test, merge_browser] if: ${{ startsWith(gitea.ref, 'refs/tags/v') || (gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'release' || inputs.stage == 'production' || inputs.stage == 'field')) }} runs-on: ubuntu-latest timeout-minutes: 45 diff --git a/config/ci/gates.json b/config/ci/gates.json index 5877462a..3875b209 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -2083,9 +2083,9 @@ ], "jobs": [ { - "id": "merge_gate", - "displayName": "${{ matrix.gate }} / ${{ matrix.name }}", - "kind": "gate-matrix", + "id": "merge_static", + "displayName": "merge / static checks", + "kind": "gate-sequence", "needs": [], "condition": "merge", "timeoutMinutes": 45, @@ -2093,18 +2093,88 @@ "FE-GATE-001", "FE-GATE-002", "FE-GATE-003", + "FE-GATE-010", + "FE-GATE-011", + "FE-GATE-012" + ], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "checkout" + }, + { + "kind": "setup-node" + }, + { + "kind": "frozen-install" + }, + { + "kind": "run-gate" + }, + { + "kind": "upload", + "transferId": "merge-static-evidence", + "name": "merge-static-${{ gitea.run_id }}", + "paths": [ + "artifacts/" + ], + "always": true + } + ] + }, + { + "id": "merge_test", + "displayName": "merge / tests", + "kind": "gate-sequence", + "needs": [], + "condition": "merge", + "timeoutMinutes": 45, + "gateIds": [ "FE-GATE-004", "FE-GATE-005", "FE-GATE-006", "FE-GATE-007", - "FE-GATE-008", - "FE-GATE-009", - "FE-GATE-010", - "FE-GATE-011", - "FE-GATE-012", "FE-GATE-013", "FE-GATE-020" ], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "checkout" + }, + { + "kind": "setup-node" + }, + { + "kind": "frozen-install" + }, + { + "kind": "run-gate" + }, + { + "kind": "upload", + "transferId": "merge-test-evidence", + "name": "merge-test-${{ gitea.run_id }}", + "paths": [ + "artifacts/" + ], + "always": true + } + ] + }, + { + "id": "merge_browser", + "displayName": "merge / browser tests", + "kind": "gate-sequence", + "needs": [], + "condition": "merge", + "timeoutMinutes": 45, + "gateIds": [ + "FE-GATE-008", + "FE-GATE-009" + ], "browserGateIds": [ "FE-GATE-008", "FE-GATE-009" @@ -2128,8 +2198,8 @@ }, { "kind": "upload", - "transferId": "merge-gate-evidence", - "name": "${{ matrix.gate }}-${{ gitea.run_id }}", + "transferId": "merge-browser-evidence", + "name": "merge-browser-${{ gitea.run_id }}", "paths": [ "artifacts/" ], @@ -2142,7 +2212,9 @@ "displayName": "${{ matrix.gate }} / ${{ matrix.name }}", "kind": "gate-matrix", "needs": [ - "merge_gate" + "merge_static", + "merge_test", + "merge_browser" ], "condition": "release", "timeoutMinutes": 45, diff --git a/docs/operations/ci-quality-gates.md b/docs/operations/ci-quality-gates.md index 1f6a349a..ff8a53d3 100644 --- a/docs/operations/ci-quality-gates.md +++ b/docs/operations/ci-quality-gates.md @@ -6,8 +6,10 @@ strict v2 contract; it is not an independent configuration authority. Update the registry, run `corepack pnpm generate:ci-workflow`, and commit the generated bytes together. `corepack pnpm check:ci-workflow` rejects missing, stale, CRLF, or otherwise byte-different output. `corepack pnpm check:ci` runs artifact-schema -checking, the typed contract checker, and this workflow drift check. The Gitea -adapter runs each gate as an independent matrix check with full fan-out and no +checking, the typed contract checker, and this workflow drift check. The merge +stage runs as three jobs (`merge_static`, `merge_test`, `merge_browser`), one +install each; every gate is a step named by its ID, and a failed gate does not +skip the next. Release and production gates stay matrix checks. There is no soft-fail wiring. ## 기준선 갱신과 새 프로젝트 시작 시 초기화할 기준선 @@ -407,9 +409,9 @@ the paired backend: `{ "id": "PRODUCT-GATE-001", "name": "backend-contract", "script": "check:backend-contract" }`. Ids are `PRODUCT-GATE-NNN`; the `FE-GATE-NNN` ids, their commands, artifacts and readiness formula stay the template's. Each runs as `corepack pnpm