Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI 파이브라인 수정 #78

Merged
merged 11 commits into from
Oct 10, 2024
32 changes: 8 additions & 24 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ permissions:

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
service: [user, auth, gateway, notification, order, payment, product, slack, promotion]

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -31,25 +35,5 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build for all modules
run: |
set -e # 오류 발생 시 스크립트 종료

# 모든 모듈을 찾습니다. (build.gradle 파일이 있는 디렉토리)
MODULES=$(find ./service -type f \( -name "build.gradle" \) -exec dirname {} \; | sort -u)

echo "Modules to build:"
echo "$MODULES"

# 각 모듈에 대해 순차적으로 빌드
for folder in $MODULES; do
echo "----------------------------"
echo "Building in $folder..."

if [ -f "$folder/build.gradle" ]; then
echo "Building Gradle project in $folder..."
./gradlew -p "$folder" build -x test
else
echo "Skipping $folder: build.gradle not found."
fi
done
- name: Build with Gradle
run: ./gradlew clean build -p ./service/${{ matrix.service }}/server -x test