Files
clean-architecture-backend-…/.github/workflows/ci-quality-gates.yml
T
donghyeon-kaandClaude Opus 5.5 0ed7bc8df7 review-followup Wave 3 라운드 1(P16): 빌드 게이트 정리 — JPA evidence manifest 폐기, build-tools 제거, API surface를 leaf check로
- 결정 4: JPA evidence·qualification manifest 폐기 → persistence-jpa 테스트, build-tools included build 비움(verifyEnvKeys는
  app-bootstrap 태스크, 구현은 build-logic `ca.config-contract`), gRPC release gate 삭제
- 결정 20: API surface 검사를 leaf `check`로, JPA adopter 검사를 `ca.api-surface`로 합침(구현 하나)
- 레인 단계 정리(문서 대조 레인은 `mainStage()`), integrationCheck가 입력 없는 레인을 이름과 함께 제외 → 로컬 통과(NEW-16)
- release workflow 통합, releaseCheck는 tag 전용, build-logic 비핵심 플러그인 정리, sample을 ArchUnit 대상에
- 보류 4행(B3 변경 모듈만 실행, C 이미지 서명, messaging 카드 검증 이동 2행 — 결정 필요), 남음 2행(O3-5 나머지)
- 통합: P17이 옮긴 gRPC release gate 사본 삭제, `grpc-proto-buf`를 release-gate needs에(P17-new-3)

검증: ./gradlew ci verifyDependencyLocks --warning-mode=fail 통과(685 task), mainCheck 통과(268 task),
-p optional-platforms ci 통과, -p build-logic test 78건 통과(손상된 TestKit 캐시 삭제 후)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 16:44:17 +09:00

139 lines
6.1 KiB
YAML

name: ci-quality-gates
# The pull-request gate. Everything here blocks a merge.
#
# The job list used to include `gate-matrix-lint`, which ran .github/scripts/verify-gate-matrix.sh
# against .github/ci-gate-matrix.yml: a 1,025-line register of all 107 CI controls, checked for
# consistency against the Gradle task graph and this workflow by a 568-line shell script, which was
# itself checked by contract tests in :app-bootstrap. Adding one check meant editing Gradle, a
# workflow, the matrix, the verifier's expectations and a Java test. The information was already in
# the task graph and the job graph; the matrix was a third copy that had to be kept equal to both.
on:
pull_request:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TESTCONTAINERS_REUSE_ENABLE: "false"
jobs:
quality-gates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
- uses: ./.github/actions/setup-gradle-java
- name: Export the live Gradle verification task map
working-directory: src
run: ./gradlew tasks --group verification --console=plain > ../verification-tasks.txt
- name: Upload the Gradle verification task map
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # actions/upload-artifact@v7.0.1
with:
name: gradle-verification-task-map
path: verification-tasks.txt
if-no-files-found: error
# `ci`, not `check`. A leaf's `check` is that leaf's — compile, its tests, Spotless, Checkstyle
# and Error Prone — and the repository-wide gates are named tasks of their own:
# ci = every leaf check + architectureCheck + qualityCheck
# A leaf's `check` includes its API surface verification (owner decision 20). The main-branch
# stage (`mainCheck`: environment contract, full-boot qualification, public-path baseline,
# transport and messaging lanes, document-contract lanes) runs in integration-main.yml.
- name: Run the pull-request gate
working-directory: src
run: ./gradlew :ci :verifyDependencyLocks --warning-mode=fail --stacktrace
- name: Verify Compose profile contracts render exactly as declared
run: bash scripts/verify-compose-profile-contracts.sh
sample-portfolio:
# The sample is excluded from production architecture/runtime membership policy, but it is still
# the reference implementation adopters copy. Compile/test/OpenAPI drift must therefore block PRs.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
- uses: ./.github/actions/setup-gradle-java
- name: Verify the standalone sample application
working-directory: src
run: ./gradlew :sample-portfolio:check --stacktrace
optional-platforms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
- uses: ./.github/actions/setup-gradle-java
- name: Verify the optional gRPC platform build
working-directory: src
run: ./gradlew -p optional-platforms ci --stacktrace
# gRPC schema policy (owner decision 18). protoc compiles src/grpc/grpc-contract inside the
# optional-platforms build above; lint and breaking-change policy belong to Buf, configured by
# buf.yaml next to the schema. Buf is a native binary rather than a Maven artifact, so it runs here
# and not inside Gradle — and nothing in the repository re-implements its rules.
grpc-proto-buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
with:
# buf breaking reads the baseline schema from Git history.
fetch-depth: 0
- uses: bufbuild/buf-action@85aebf73123b5c15fd5528aaecbf9129cddf7fa7 # bufbuild/buf-action@v1.6.0
with:
version: 1.73.0
setup_only: true
- name: Lint the gRPC schema
working-directory: src/grpc/grpc-contract
run: buf lint
- name: Refuse a breaking change to the gRPC schema
working-directory: src/grpc/grpc-contract
env:
# Pull request: the target branch. Push: the commit this push replaced.
BASELINE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
run: |
set -euo pipefail
baseline_commit="$(git rev-parse --verify --quiet "${BASELINE}^{commit}" || true)"
if [[ -z "${baseline_commit}" ]] \
|| ! git cat-file -e "${baseline_commit}:src/grpc/grpc-contract/buf.yaml" 2>/dev/null; then
# The first change that introduces the module has nothing to be compatible with.
echo "::notice::grpc-proto-buf: baseline ${BASELINE} has no src/grpc/grpc-contract/buf.yaml; breaking check skipped."
exit 0
fi
buf breaking --against "../../../.git#ref=${baseline_commit},subdir=src/grpc/grpc-contract"
release-gate:
needs:
- quality-gates
- sample-portfolio
- optional-platforms
- grpc-proto-buf
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Require every current blocking job to succeed
env:
QUALITY_RESULT: ${{ needs.quality-gates.result }}
SAMPLE_RESULT: ${{ needs.sample-portfolio.result }}
OPTIONAL_PLATFORMS_RESULT: ${{ needs.optional-platforms.result }}
GRPC_PROTO_BUF_RESULT: ${{ needs.grpc-proto-buf.result }}
run: |
set -euo pipefail
for result in \
"${QUALITY_RESULT}" \
"${SAMPLE_RESULT}" \
"${OPTIONAL_PLATFORMS_RESULT}" \
"${GRPC_PROTO_BUF_RESULT}"; do
if [[ "${result}" != "success" ]]; then
echo "::error::release-gate: required job result was ${result}"
exit 1
fi
done
echo "release-gate: all current blocking quality jobs succeeded."