Skip to content

Commit

Permalink
fix(#77): CI 파이브라인 수정
Browse files Browse the repository at this point in the history
- 여러 개의 서비스 빌드 과정 수정
  • Loading branch information
kyeonkim committed Oct 8, 2024
1 parent 60c51bf commit 101e7f8
Showing 1 changed file with 15 additions and 27 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,35 @@ permissions:

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

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'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- 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: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build
working-directory: service/${{ matrix.service }}

0 comments on commit 101e7f8

Please sign in to comment.