Skip to content

Commit

Permalink
refactor: 빌드 속도 향상을 위한 Gradle 캐시 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
peeerr committed Nov 6, 2024
1 parent c859e7a commit 69ea6d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/master_weekly_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ jobs:
- name: 프로젝트 코드를 CI 서버로 옮겨오기
uses: actions/checkout@v4

- name: Gradle 캐시 설정
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: JDK 21 설치
uses: actions/setup-java@v4
with:
Expand All @@ -39,8 +49,8 @@ jobs:
- name: 빌드로 테스트 수행 및 Jar 파일 생성
run: |
chmod +x ./gradlew
./gradlew clean build
mv build/libs/*SNAPSHOT.jar ./app.jar
./gradlew clean build --build-cache
- run: mv build/libs/*SNAPSHOT.jar ./app.jar

- name: 생성된 Jar 파일 EC2 서버로 전송하기
uses: appleboy/[email protected]
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/pr_weekly_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ jobs:
- name: 프로젝트 코드를 CI 서버로 옮겨오기
uses: actions/checkout@v4

- name: Gradle 캐시 설정
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: JDK 21 설치
uses: actions/setup-java@v4
with:
Expand All @@ -42,7 +52,7 @@ jobs:
- name: 빌드 테스트 수행
run: |
chmod +x ./gradlew
./gradlew clean build --stacktrace
./gradlew clean build --build-cache --stacktrace
- name: 테스트 수행 결과 보고
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down

0 comments on commit 69ea6d2

Please sign in to comment.