generated from JetBrains/compose-multiplatform-ios-android-template
-
Notifications
You must be signed in to change notification settings - Fork 1
193 lines (158 loc) · 4.85 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Build NetWorth (Build Test & Check)
on:
push:
branches:
- main
pull_request:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Verify Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Code Quality
run: ./gradlew detekt ktlintCheck
build-android:
name: Build, Test & Check (Android)
runs-on: ubuntu-latest
needs: [ code-quality ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Build android app
run: ./gradlew assembleDebug
- name: Run Android Unit Tests
run: ./gradlew :androidApp:testDebugUnitTest
- name: Run Lint
run: ./gradlew :androidApp:lintDebug
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: "**/build/reports/kover/report.xml"
build-ios:
name: Build, Test & Check (iOS)
runs-on: macos-13
needs: [ code-quality ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Setup Fastlane
run: bundle install
- name: Decrypt large secret
run: |
./.github/scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- name: Build iOS app
env:
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
CI: true
run: |
bundle exec fastlane ios build_for_test
# run: |
# xcodebuild \
# -project iosApp/iosApp.xcodeproj \
# -configuration Debug \
# -scheme iosApp \
# -sdk iphoneos \
# -destination name='iPhone 14 Pro' \
# build
- name: Run iOS unit tests
env:
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
CI: true
run: |
bundle exec fastlane ios test_without_building
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# run: |
# xcodebuild clean test \
# -project iosApp/iosApp.xcodeproj \
# -configuration Debug \
# -scheme iosApp \
# -sdk iphoneos \
# -destination name='iPhone 14 Pro' \
# -test-timeouts-enabled YES \
# build
coverage-report:
name: Code coverage report & verification
runs-on: macos-12
needs: [ build-android, build-ios ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Run all tests
run: ./gradlew allTests
- name: Generate Coverage Report
run: ./gradlew koverXmlReport
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: "**/build/reports/kover/report.xml"
# androidTest:
# runs-on: macos-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# distribution: 'zulu'
# java-version: 17
#
# - name: Android Instrumentation Tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# target: google_apis
# script: ./gradlew androidApp:connectedAndroidTest