Skip to content

Commit b0e0bb5

Browse files
authored
refactor ( #1 ) : build-check-yml 수정
1 parent 4107dfc commit b0e0bb5

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

.github/workflows/build-check.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
name: Build Check
1+
name: Spring Build Check
22

33
on:
44
push:
55
branches: [ '*' ]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [ main, develop, release/*, hotfix/* ]
8+
workflow_dispatch:
89

910
jobs:
1011
build:
1112
name: Build Check
1213
runs-on: ubuntu-latest
13-
14+
timeout-minutes: 15
1415
steps:
15-
- uses: actions/checkout@v3
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
1620

1721
- name: Set up JDK
1822
uses: actions/setup-java@v3
@@ -21,13 +25,34 @@ jobs:
2125
distribution: 'temurin'
2226
cache: gradle
2327

28+
- name: Cache Gradle packages
29+
uses: actions/cache@v3
30+
with:
31+
path: |
32+
~/.gradle/caches
33+
~/.gradle/wrapper
34+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
35+
restore-keys: |
36+
${{ runner.os }}-gradle-
37+
2438
- name: Grant execute permission for gradlew
2539
run: chmod +x ./gradlew
2640

2741
- name: Build with Gradle
28-
run: ./gradlew clean build
42+
run: ./gradlew clean build --no-daemon
2943

30-
# 빌드 실패 시 브랜치 보호를 위한 스크립트
44+
- name: Upload build reports
45+
if: always()
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: build-reports
49+
path: |
50+
**/build/reports/
51+
**/build/test-results/
52+
retention-days: 7
53+
3154
- name: Fail if build failed
3255
if: failure()
33-
run: exit 1
56+
run: |
57+
echo "빌드에 실패했습니다. 로컬에서 오류를 수정한 후 다시 시도하세요."
58+
exit 1

0 commit comments

Comments
 (0)