forked from codesquad-members-2024/issue-tracker
-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (44 loc) · 1.41 KB
/
server-ci.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
name: CI with Gradle
on:
push:
branches: [ "be/**" ]
pull_request:
branches: [ "be/**" ]
# 워크플로우가 저장소의 콘텐츠를 읽을 수 있는 권한을 갖도록 설정
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
cache: gradle
- name: Make application.properties
run: |
cd ./be/issue-tracker/src/main
mkdir resources
cd resources
touch application.properties
echo "${{ secrets.PROPERTIES }}" > ./application.properties
shell: bash
- name: Grant execute permission for gradlew
run: |
cd ./be/issue-tracker
chmod +x gradlew
# Gradle Daemon을 사용하지 않도록 지정
# CI 환경에서는 Daemon을 사용하지 않는 것이 일반적
# 이유는 각 빌드가 깨끗한 환경에서 실행되며, Daemon이 이전 빌드의 상태를 유지하지 않기 때문
- name: Run tests with Gradle
run: |
cd ./be/issue-tracker
./gradlew test --no-daemon
- name: Build with Gradle
run: |
cd ./be/issue-tracker
./gradlew build -x test --no-daemon