-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (34 loc) · 1.15 KB
/
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
name: gradle build
on:
pull_request:
branches: [ main ]
# 권한 설정
permissions: write-all
# Work
jobs:
build:
runs-on: ubuntu-latest # 실행 환경
steps:
- uses: actions/checkout@v3 # 기본 체크아웃 동작
# Java version 세팅
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# 환경 변수 설정
- name: Set up Environment
run: echo "${{ secrets.ENV_PROPERTIES_LOCAL }}" > ./.env
# docker로 Test용 mysql 띄우기
- name: Create Mysql Docker Container
run: sudo docker run -d -p 3306:3306 --env MYSQL_DATABASE="${{ secrets.TEST_DATABASE }}" --env MYSQL_ROOT_PASSWORD="${{ secrets.TEST_DATASOURCE_PASSWORD }}" mysql:8.0.31
# 빌드시 캐시 적용
- name: Cache Gradle Packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
# 빌드
- name: Build with Gradle
run: ./gradlew build