-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (108 loc) · 3.52 KB
/
main.yml
File metadata and controls
138 lines (108 loc) · 3.52 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
pull_request:
branches: [main, dev]
jobs:
code_quality:
name: 코드 품질 검사
runs-on: ubuntu-latest
steps:
- name: 코드 체크아웃
uses: actions/checkout@v3
- name: Node.js 설정
uses: actions/setup-node@v3
with:
node-version: '16'
- name: 의존성 설치
run: npm install
- name: ESLint 실행
run: npm run lint
- name: Prettier 검사
run: npx prettier --write .
- name: TypeScript 타입 검사
run: npx tsc --noEmit
android_build:
name: 안드로이드 빌드
runs-on: ubuntu-latest
needs: code_quality
if: github.event.pull_request.base.ref == 'main' # Only run on PRs to main
steps:
- name: 코드 체크아웃
uses: actions/checkout@v3
- name: 의존성 캐시
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Node.js 설정
uses: actions/setup-node@v3
with:
node-version: '16'
- name: 의존성 설치
run: npm install
- name: Java 설정
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: 안드로이드 SDK 설치
uses: android-actions/setup-android@v2
- name: 안드로이드 SDK 라이선스 동의
run: yes | sdkmanager --licenses
- name: Google Service File 생성 (Android)
run: |
echo $GOOGLE_SERVICE_DEV_JSON | base64 --decode > google-services.development.json
env:
GOOGLE_SERVICE_DEV_JSON: ${{ secrets.GOOGLE_SERVICE_DEV_JSON }}
- name: Expo Prebuild
run: APP_MODE=development npx expo prebuild --platform android
- name: Gradle 캐시
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 안드로이드 앱 빌드
run: |
cd android
./gradlew assembleDebug
ios_build:
name: iOS 빌드
runs-on: macos-latest
needs: code_quality
if: github.event.pull_request.base.ref == 'main' # Only run on PRs to main
steps:
- name: 코드 체크아웃
uses: actions/checkout@v3
- name: 의존성 캐시
uses: actions/cache@v3
with:
path: |
node_modules
ios/Pods
key: ${{ runner.os }}-deps-${{ hashFiles('package-lock.json', 'ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-deps-
- name: Node.js 설정
uses: actions/setup-node@v3
with:
node-version: '16'
- name: 의존성 설치
run: npm install
- name: Google Service File 생성 (iOS)
run: |
echo $GOOGLE_SERVICE_DEV_PLIST | base64 --decode > GoogleService-Info.development.plist
env:
GOOGLE_SERVICE_DEV_PLIST: ${{ secrets.GOOGLE_SERVICE_DEV_PLIST }}
- name: Expo Prebuild
run: APP_MODE=development npx expo prebuild --platform ios
- name: CocoaPods 의존성 설치
run: |
cd ios
pod install
- name: iOS 앱 빌드
run: |
xcodebuild -workspace onestep.xcworkspace -scheme onestep -sdk iphonesimulator -configuration Debug build