refactor: 빌드 최적화 및 ci 수정

This commit is contained in:
donghyeon-ka
2026-09-17 15:24:31 +09:00
parent 944a1e348b
commit ace8aaaef6
263 changed files with 1975 additions and 3130 deletions
+52 -71
View File
@@ -45,31 +45,26 @@ jobs:
- uses: ./.github/actions/setup-gradle-java
# `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 + configContractCheck
# ci = every leaf check + architectureCheck + qualityCheck + configContractCheck + qualificationCheck
# so CI runs strictly more than it used to while `./gradlew :domain-core:check` runs strictly
# less.
- name: Run the pull-request gate
working-directory: src
run: ./gradlew ci verifyPublicPathSnapshot verifyDependencyLocks --warning-mode=fail --no-daemon --stacktrace
run: ./gradlew :ci :verifyPublicPathSnapshot :verifyDependencyLocks --warning-mode=fail --stacktrace
# build-logic is an included build: its own suite is not reachable from the root project's
# `check`, so the convention plugins every leaf applies would otherwise ship untested.
- name: Test the build-logic convention plugins
working-directory: src
run: ./gradlew -p build-logic test --no-daemon --stacktrace
run: ./gradlew -p build-logic test --stacktrace
# Named as its own step because nothing else runs it: `check` does not depend on
# graphqlStableTest, so the lane's required-class guard — the check that its module-boundary
# suite has not silently stopped being discovered — would protect nothing in CI.
- name: Qualify the GraphQL Stable lane
working-directory: src
run: ./gradlew :adapter:inbound:graphql:graphqlStableTest --no-daemon --stacktrace
run: ./gradlew :adapter:inbound:graphql:graphqlStableTest --stacktrace
- name: Qualify opt-in inbound transports without skips
working-directory: src
run: ./gradlew conditionalTransportQualification --no-daemon --stacktrace
sample-off:
uses: ./.github/workflows/_reusable-gradle.yml
with:
tasks: ":app-bootstrap:sampleOffTest verifyCleanArchitectureDependencies"
run: ./gradlew :conditionalTransportQualification --stacktrace
redis-sdk:
# Milestone A of the Redis wrapper/typed API plan: policy catalog, typed API parity, permit
@@ -82,12 +77,43 @@ jobs:
# `configContractCheck`, which the quality-gates job covers.
uses: ./.github/workflows/_reusable-gradle.yml
with:
tasks: >-
:shared-contract:edgeRateLimitContractTest
:adapter:outbound:cache-redis:check
:app-bootstrap:verifyEnvKeys
verifyCleanArchitectureDependencies
verifyPublicPathSnapshot
tasks: ":shared-contract:edgeRateLimitContractTest"
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
configuration-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
- uses: ./.github/actions/setup-gradle-java
- name: Store configuration cache for the everyday core build
working-directory: src
run: >-
./gradlew
:domain-core:check
:application-core:check
--configuration-cache
--configuration-cache-problems=fail
--stacktrace
- name: Require configuration-cache reuse
working-directory: src
shell: bash
run: |
set -euo pipefail
output="$({ ./gradlew :domain-core:check :application-core:check \
--configuration-cache --configuration-cache-problems=fail --stacktrace; } 2>&1)"
printf '%s\n' "${output}"
grep -Fq 'Reusing configuration cache.' <<<"${output}" || {
echo '::error::Gradle did not reuse the configuration cache on the second identical build.'
exit 1
}
jpa-candidate-evidence:
runs-on: ubuntu-latest
@@ -100,7 +126,7 @@ jobs:
run: >-
./gradlew
:adapter:outbound:persistence-jpa:verifyJpaCandidateEvidence
--no-daemon
--stacktrace
- name: Retain content-addressed JPA candidate manifests
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # actions/upload-artifact@v7.0.1
@@ -116,85 +142,40 @@ jobs:
quarantine:
uses: ./.github/workflows/_reusable-gradle.yml
with:
tasks: quarantineTest
gradle-args: "--no-daemon"
tasks: ":quarantineTest"
gradle-args: "--stacktrace"
continue-on-error: true
release-gate:
needs:
- quality-gates
- sample-off
- redis-sdk
- jpa-candidate-evidence
- optional-platforms
- configuration-cache
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
checks: read
steps:
- name: Require every current blocking job to succeed
env:
QUALITY_RESULT: ${{ needs.quality-gates.result }}
SAMPLE_OFF_RESULT: ${{ needs.sample-off.result }}
REDIS_RESULT: ${{ needs.redis-sdk.result }}
JPA_CANDIDATE_RESULT: ${{ needs.jpa-candidate-evidence.result }}
OPTIONAL_PLATFORMS_RESULT: ${{ needs.optional-platforms.result }}
CONFIGURATION_CACHE_RESULT: ${{ needs.configuration-cache.result }}
run: |
set -euo pipefail
for result in \
"${QUALITY_RESULT}" \
"${SAMPLE_OFF_RESULT}" \
"${REDIS_RESULT}" \
"${JPA_CANDIDATE_RESULT}"; do
"${JPA_CANDIDATE_RESULT}" \
"${OPTIONAL_PLATFORMS_RESULT}" \
"${CONFIGURATION_CACHE_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."
# `needs` cannot reach another workflow, so a blocking check in another file has to be required
# by result. dependency-vulnerability.yml answers the same pull_request and push-to-main
# triggers as this workflow and trivy-fs carries no `if:` guard, so its check run always exists
# for this SHA — which is what makes it requirable rather than a matter of scheduling luck.
# Only `success` passes: a skipped or cancelled security scan is not a scan.
#
# The release-tag and path-filtered workflows (release.yml, jpa-release.yml,
# fileserver-certification.yml, object-storage-qualification.yml, messaging-certification.yml)
# run on triggers this job does not share, so they cannot be required here without changing
# when they run. That is a stated gap, not a hidden one.
- name: Require the cross-workflow release-blocking checks to have succeeded
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
REQUIRED_CHECKS: trivy-fs
run: |
set -euo pipefail
deadline=$(( $(date +%s) + 1800 ))
for required in ${REQUIRED_CHECKS}; do
while :; do
result="$(
gh api \
"repos/${GH_REPO}/commits/${COMMIT_SHA}/check-runs?check_name=${required}&per_page=100" \
--jq '[.check_runs[]] | sort_by(.started_at) | last
| if . == null then "absent none"
else "\(.status) \(.conclusion // "none")" end'
)"
check_status="${result%% *}"
check_conclusion="${result##* }"
if [[ "${check_status}" == "completed" ]]; then
break
fi
if (( $(date +%s) >= deadline )); then
echo "::error::release-gate: release-blocking check ${required} reported no result for ${COMMIT_SHA} (status ${check_status})"
exit 1
fi
echo "release-gate: waiting for ${required} (status ${check_status})"
sleep 30
done
if [[ "${check_conclusion}" != "success" ]]; then
echo "::error::release-gate: release-blocking check ${required} concluded ${check_conclusion}"
exit 1
fi
echo "release-gate: ${required} concluded success."
done