-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (89 loc) · 2.96 KB
/
Copy pathci.yml
File metadata and controls
103 lines (89 loc) · 2.96 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
name: CI
on:
pull_request:
branches: [develop]
push:
branches: [develop, main]
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
check:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: detekt
task: detekt
- name: lint
task: lint
- name: test
task: test
- name: build
task: assembleRelease assembleInternal
- name: build-debug
task: assembleDebug
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: false
# 모델(.tflite/.onnx)이 필요한 build 잡만 받습니다. 레포에는 LFS 로도 들어 있지만, CI/CD 가 매
# 실행마다 LFS 에서 받으면 레포의 대역폭 예산이 소진되므로 Release 자산에서 받습니다.
# 모델을 교체할 때는 LFS 와 Release 를 함께 갱신해야 합니다(scripts/fetch-models.sh 참고).
- name: Download on-device models
if: ${{ matrix.name == 'build' || matrix.name == 'build-debug' }}
env:
GH_TOKEN: ${{ github.token }}
run: ./scripts/fetch-models.sh
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true
- name: Write google-services.json
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > app/google-services.json
- name: Write local.properties
shell: bash
run: |
printf 'DEV_BASE_URL=%s\n' "${{ secrets.DEV_BASE_URL }}" > local.properties
printf 'PROD_BASE_URL=%s\n' "${{ secrets.PROD_BASE_URL }}" >> local.properties
- name: Run ${{ matrix.task }}
run: ./gradlew ${{ matrix.task }} --stacktrace
- name: Upload detekt SARIF to code scanning
if: ${{ always() && matrix.name == 'detekt' }}
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: build/reports/detekt/merged.sarif
category: detekt
- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-reports
path: |
**/build/reports/**
**/build/test-results/**
if-no-files-found: ignore
retention-days: 7
- name: Upload APKs
if: ${{ success() && matrix.name == 'build' }}
uses: actions/upload-artifact@v4
with:
name: app-apks
path: |
app/build/outputs/apk/release/*.apk
app/build/outputs/apk/internal/*.apk
if-no-files-found: error
retention-days: 7