-
Notifications
You must be signed in to change notification settings - Fork 11
212 lines (170 loc) · 5.97 KB
/
validate.yml
File metadata and controls
212 lines (170 loc) · 5.97 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Validate Build
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
android-lint:
name: Android Lint ${{ matrix.variant }}
if: ${{ always() }}
runs-on: ubuntu-latest
strategy:
matrix:
variant: [ fdroid, full ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run lint
run: |
./gradlew copyBrandingToCommonResources lint${{ matrix.variant }}Debug || {
echo "::warning::Android Lint ${{ matrix.variant }} failed. Check the uploaded reports for details."
exit 0
}
- name: Uploads test reports
uses: actions/upload-artifact@v4
if: always()
with:
name: android-lint-${{ matrix.variant }}-report
path: composeApp/build/reports/
retention-days: 7
kotlin-lint:
name: Kotlin Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run lint
run: ./gradlew copyBrandingToCommonResources ktlintCheck
- name: Uploads test reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: kotlin-lint-report
path: composeApp/build/reports/ktlint/
retention-days: 7
common-tests:
name: Common Tests
runs-on: macos-latest
strategy:
matrix:
organization: [ ooni, dw ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run common tests
run: ./gradlew copyBrandingToCommonResources :composeApp:desktopTest -Porganization=${{ matrix.organization }}
- name: Uploads test reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: common-tests-report-${{ matrix.organization }}
path: composeApp/build/reports/tests/desktopTest/
retention-days: 7
build-android:
name: Build Android
runs-on: ubuntu-latest
strategy:
matrix:
organization: [ ooni, dw ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build release Android APK
run: ./gradlew copyBrandingToCommonResources assembleFullRelease -Porganization=${{ matrix.organization }}
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.organization }}-release-APK
path: composeApp/build/outputs/apk/full/release/composeApp-full-universal-release.apk
retention-days: 7
build-ios:
name: Build iOS
runs-on: macos-26
strategy:
matrix:
organization: [ ooni, dw ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Set Xcode version
run: |
sudo xcode-select -switch /Applications/Xcode_26.0.1.app
- name: Xcode Cache
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.organization }}-${{ github.sha }}
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.organization }}-
- name: Kotlin Native Cache
uses: actions/cache@v4
with:
path: |
~/.konan
key: kotlin-native-${{ hashFiles('**/libs.versions.toml') }}
- name: CocoaPods Cache
uses: actions/cache@v4
with:
path: |
Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: pods-
- name: Build iOS App
run: bundle exec fastlane ios build organization:${{ matrix.organization }}
continue-on-error: false
build-desktop:
name: Build Desktop
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Package Desktop app
run: ./gradlew copyBrandingToCommonResources packageDistributionForCurrentOS
- name: Uploads artifacts
uses: actions/upload-artifact@v4
with:
name: DesktopApp
path: composeApp/build/compose/binaries/**/**/*
retention-days: 7
distribute:
name: Firebase App Distribution
runs-on: ubuntu-latest
needs: [build-android, common-tests]
if: github.ref == 'refs/heads/main'
strategy:
matrix:
organization: [ ooni, dw ]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.organization }}-release-APK
path: composeApp/build/outputs/apk/full/release/
- name: Firebase App Distribution
id: uploadArtifact
env:
INPUT_APP_ID: ${{ fromJSON(secrets.FIREBASE_APP_ID)[matrix.organization] }}
INPUT_SERVICE_CREDENTIALS_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
GOOGLE_APPLICATION_CREDENTIALS: service_credentials_content.json
INPUT_GROUPS: testers
INPUT_FILE: composeApp/build/outputs/apk/full/release/composeApp-full-universal-release.apk
run: |
cat <<< "${INPUT_SERVICE_CREDENTIALS_FILE_CONTENT}" > service_credentials_content.json
sudo npm install -g firebase-tools
OUTPUT=$(firebase appdistribution:distribute "$INPUT_FILE" --app "$INPUT_APP_ID" --groups "$INPUT_GROUPS" --testers "$INPUT_TESTERS" --release-notes "$(git show -s --format='%an <%ae> , Hash : %H, Message : %s')")
echo "$OUTPUT"
DASHBOARD_URL=$(echo "$OUTPUT" | grep -o 'https://console.firebase.google.com/.*')
echo "Dashboard URL( ${{ matrix.organization }} ): $DASHBOARD_URL" >> $GITHUB_STEP_SUMMARY