-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (43 loc) · 1.48 KB
/
gradle-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CI with Gradle
on:
pull_request:
branches: [ dev ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
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