diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 1ead4b1e..0bac68b7 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -43,7 +43,8 @@ env: TESTCONTAINERS_REUSE_ENABLE: "false" jobs: - # Both main-branch stages in one Gradle run (build.gradle `strictLaneStages` says why). + # Both main-branch stages in one Gradle run, the integration stage first (build.gradle + # `strictLaneStages` says why). # mainCheck: environment contract, full-boot qualification, public-path baseline, transport and # messaging qualification, document-contract lanes, test-code analysis, the feature generator # round trip. integrationCheck: every integration-category strict lane, against real PostgreSQL, @@ -56,7 +57,7 @@ jobs: steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - - run: ./gradlew :mainCheck :integrationCheck --continue + - run: ./gradlew :integrationCheck :mainCheck --continue # The included build's own tests (TestKit for the convention plugins). The main task graph does # not reach them; `ci` already runs every plugin they test (owner decision 2026-11-07: main stage). diff --git a/build-logic/AGENTS.md b/build-logic/AGENTS.md index 85a4cb4c..22483be7 100644 --- a/build-logic/AGENTS.md +++ b/build-logic/AGENTS.md @@ -26,7 +26,7 @@ registry, settings, build-logic, 루트 라이프사이클이 정하는 것을 ## 단계 job의 모양 - `verifyStrictLaneStages --dry-run`(PR)은 `explicitOnly`가 아닌 strict lane마다 `build.gradle`의 `strictLaneStages`가 선언한 단계 태스크 하나의 계획에 들어 있는지 본다(그래프 검사). -- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고(같은 job을 쓰는 단계는 선언한 `line`대로 한 줄을 나눠 쓸 수 있다: `./gradlew :mainCheck :integrationCheck --continue`), 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). +- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고(같은 job을 쓰는 단계는 선언한 `line`대로 한 줄을 나눠 쓸 수 있다: `./gradlew :integrationCheck :mainCheck --continue`), 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다). - 단계를 더하거나 job을 바꾸면 `strictLaneStages`의 `stage` 줄과 workflow를 같은 커밋에서 고친다. ## 테스트 diff --git a/build.gradle b/build.gradle index 8df4fdb1..8137ccdc 100644 --- a/build.gradle +++ b/build.gradle @@ -247,10 +247,15 @@ strictLaneStages { // main stage's analysis and the feature generator's nested build run while the integration // lanes take turns on the one real-server slot. Two jobs spent about 34 runner minutes on a push // (run 79), two of them compiling the same modules twice. + // integrationCheck comes first on the line because Gradle starts ready work in the order of + // the requested tasks: the integration lanes' compiles go first and the slot is busy from the + // first minute. Second on the line, the lanes waited about ten minutes behind the main stage's + // analysis and then ran one at a time on an idle machine (desktop 1,760 s, first on the line + // 1,484 s, same commit range). stage ':mainCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main', - options: '--continue', line: ':mainCheck :integrationCheck' + options: '--continue', line: ':integrationCheck :mainCheck' stage ':integrationCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main', - options: '--continue', line: ':mainCheck :integrationCheck' + options: '--continue', line: ':integrationCheck :mainCheck' stage ':performanceCheck', workflow: 'main.yml', event: 'schedule', job: 'performance', options: '--continue', condition: '${{ github.event_name != \'push\' }}' stage ':releaseCheck', workflow: 'release.yml', event: 'push', filter: 'tags: ["v*"]', job: 'release' diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index d494e4bf..c05eaa76 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -17,7 +17,7 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트) | `docs` | `check-work-docs.py`, `check-docs.py`, `scripts/tests` 자기 시험, `check-repo-layout.py`(Gradle 없음, 노트북 가능) | `pr.yml`의 `prCheck` 안 | | `leaf ` | 그 leaf의 `check` | — | | `pr` | `./gradlew :prCheck`, `./gradlew :verifyStrictLaneStages --dry-run` | `pr.yml` `done` | -| `main` | `:mainCheck :integrationCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) | +| `main` | `:integrationCheck :mainCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) | | `nightly` | compose smoke 전부, 마지막에 `:performanceCheck --continue` | `main.yml`(schedule·수동) | | `release` | `:releaseCheck`(지금 커밋을 provenance로) | `release.yml` `release` | | `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — | @@ -39,8 +39,8 @@ workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `v | `verifyStrictLaneStages --dry-run` | `explicitOnly`가 아닌 strict lane이 단계 태스크 하나의 계획에 들어 있는가(그래프 검사), 단계마다 선언한 workflow job이 `./gradlew <단계>` 한 줄을 정해진 조건으로 돌리는가(형식 검사) | PR | `pr.yml` `done` 둘째 줄. 형식은 `build-logic/AGENTS.md` | | `python3 scripts/check-repo-layout.py` | 저장소 루트와 `src/` 최상위에 허용 목록 밖의 항목이 없는가, registry 경로가 허용 폴더 안인가. 아무도 가리키지 않는 compose·스크립트 파일은 경고 | PR(`prCheck` 안) | `verifyRepositoryLayout` | | `python3 scripts/check-docs.py` | 살아 있는 문서의 언어, 기록·ADR 머리 블록, 문서의 인라인 코드 경로·Gradle 경로가 지금 있는가, 복사한 숫자, 상대 링크(`docs/README.md` 「문서 검사」) | PR(`prCheck` 안) | `documentCheck` | -| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue` | -| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue`(두 단계를 Gradle 한 번에. 한 번 컴파일하고, 직렬 lane이 도는 동안 나머지가 겹친다) | +| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :integrationCheck :mainCheck --continue` | +| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `main`: `./gradlew :integrationCheck :mainCheck --continue`(두 단계를 Gradle 한 번에. 한 번 컴파일하고, 직렬 lane이 도는 동안 나머지가 겹친다. integration이 앞이라 lane이 첫 몇 분부터 슬롯을 쓴다) | | `performanceCheck` | 선언된 performance lane 전체(부하·종료·풀·자원 한계, 실 서버와 컨테이너). 상한을 매번 단언한다. 손으로 돌리든 workflow든 같은 상한이다 | nightly(다른 무거운 job 뒤: 파일 맨 끝 job이고 runner 하나가 job을 만든 순서대로 돈다. `needs`는 쓰지 않는다 — Gitea 1.27이 `needs`와 `if`를 함께 가진 job을 Blocked에 둔다) | `main.yml` `performance`. 5절 | | `releaseCheck` | 릴리스 provenance + 공개 경로 스냅숏. 커밋을 `GITHUB_SHA`·`GIT_SHA`·`-PgitRevision=`로 받고, 없으면 설계대로 실패한다 | 태그 | `release.yml` `release` | | `:app-bootstrap:verifyEnvKeys` | env 키 레지스트리와 profile YAML·`.env.example` | `mainCheck` 안(`configContractCheck`) | build-logic `ca.config-contract` | diff --git a/scripts/verify.sh b/scripts/verify.sh index 6d5d386d..0e4c90e5 100755 --- a/scripts/verify.sh +++ b/scripts/verify.sh @@ -71,7 +71,7 @@ run_pr() { } run_main() { - gradle :mainCheck :integrationCheck --continue + gradle :integrationCheck :mainCheck --continue gradle -p build-logic test bash scripts/ci/verify-configuration-cache.sh }