Skip to content

Commit c25c2c2

Browse files
committed
[NDGL-108] chore: CI 워크플로우를 병렬 실행 및 재사용 가능한 구조로 개선
1 parent 93de905 commit c25c2c2

2 files changed

Lines changed: 81 additions & 39 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI Setup
2+
description: Common setup steps for CI jobs
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: actions/checkout@v4
8+
9+
- name: Setup Gradle
10+
uses: gradle/actions/setup-gradle@v4
11+
with:
12+
gradle-home-cache-cleanup: true
13+
14+
- name: Set up JDK 21
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '21'
18+
distribution: 'temurin'
19+
20+
- name: Grant execute permission for gradlew
21+
run: chmod +x gradlew
22+
shell: bash
23+
24+
- name: Download config files
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: config-files

.github/workflows/android_ci.yml

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,62 @@ on:
66
pull_request:
77
branches: [ "develop" ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
14+
setup:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up local.properties
21+
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties
22+
23+
- name: Set up keystore
24+
run: |
25+
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/ndgl.keystore
26+
echo "KEYSTORE_PATH=../app/ndgl.keystore" >> local.properties
27+
echo "KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}" >> local.properties
28+
echo "KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}" >> local.properties
29+
echo "KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> local.properties
30+
echo "NDGL_BASE_URL_DEBUG=${{ secrets.NDGL_BASE_URL_DEBUG }}" >> local.properties
31+
echo "NDGL_BASE_URL_RELEASE=${{ secrets.NDGL_BASE_URL_RELEASE }}" >> local.properties
32+
33+
- name: Set up google-services.json
34+
run: |
35+
echo '${{ secrets.GOOGLE_SERVICES_DEBUG }}' | base64 -d > app/src/debug/google-services.json
36+
echo '${{ secrets.GOOGLE_SERVICES_RELEASE }}' | base64 -d > app/src/release/google-services.json
37+
38+
- name: Upload config files
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: config-files
42+
retention-days: 1
43+
path: |
44+
local.properties
45+
app/ndgl.keystore
46+
app/src/debug/google-services.json
47+
app/src/release/google-services.json
48+
49+
lint:
50+
needs: setup
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: ./.github/actions/ci-setup
55+
56+
- name: Code style checks
57+
run: ./gradlew ktlintCheck detekt --build-cache --parallel
58+
1059
build:
60+
needs: setup
1161
runs-on: ubuntu-latest
1262

1363
steps:
14-
- uses: actions/checkout@v4
15-
16-
- name: Setup Gradle
17-
uses: gradle/actions/setup-gradle@v4
18-
with:
19-
gradle-home-cache-cleanup: true
20-
21-
- name: Set up JDK 21
22-
uses: actions/setup-java@v4
23-
with:
24-
java-version: '21'
25-
distribution: 'temurin'
26-
27-
- name: Grant execute permission for gradlew
28-
run: chmod +x gradlew
29-
30-
- name: Set up local.properties
31-
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties
32-
33-
- name: Set up keystore
34-
run: |
35-
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/ndgl.keystore
36-
echo "KEYSTORE_PATH=../app/ndgl.keystore" >> local.properties
37-
echo "KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}" >> local.properties
38-
echo "KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}" >> local.properties
39-
echo "KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> local.properties
40-
echo "NDGL_BASE_URL_DEBUG=${{ secrets.NDGL_BASE_URL_DEBUG }}" >> local.properties
41-
echo "NDGL_BASE_URL_RELEASE=${{ secrets.NDGL_BASE_URL_RELEASE }}" >> local.properties
42-
43-
- name: Set up google-services.json
44-
run: |
45-
echo '${{ secrets.GOOGLE_SERVICES_DEBUG }}' | base64 -d > app/src/debug/google-services.json
46-
echo '${{ secrets.GOOGLE_SERVICES_RELEASE }}' | base64 -d > app/src/release/google-services.json
47-
48-
- name: Code style checks
49-
run: ./gradlew ktlintCheck detekt
50-
51-
- name: Run build
52-
run: ./gradlew assembleDebug --stacktrace
64+
- uses: ./.github/actions/ci-setup
65+
66+
- name: Run build
67+
run: ./gradlew assembleDebug --build-cache --parallel --stacktrace

0 commit comments

Comments
 (0)