Skip to content

Commit c3756e9

Browse files
authored
GitHub Actions: Upload iOS app error log on CI build failure (#1215)
1 parent 720b1fd commit c3756e9

File tree

4 files changed

+147
-119
lines changed

4 files changed

+147
-119
lines changed

.github/workflows/ci.yml

+84-77
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ name: CI
33
on:
44
push:
55
branches:
6-
- '**'
7-
- '!main'
8-
- '!develop'
9-
- '!hotfix/**'
10-
- '!release/**'
6+
- "**"
7+
- "!main"
8+
- "!develop"
9+
- "!hotfix/**"
10+
- "!release/**"
1111
workflow_dispatch:
1212
inputs:
1313
force_android:
14-
description: 'Force Android'
14+
description: "Force Android"
1515
required: false
1616
default: false
1717
type: boolean
1818
force_shared:
19-
description: 'Force shared'
19+
description: "Force shared"
2020
required: false
2121
default: false
2222
type: boolean
2323
force_ios:
24-
description: 'Force iOS'
24+
description: "Force iOS"
2525
required: false
2626
default: false
2727
type: boolean
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- name: Checkout
4444
uses: actions/[email protected]
45-
45+
4646
- name: Gradle Wrapper Validation
4747
uses: gradle/actions/wrapper-validation@v4
4848

@@ -63,24 +63,24 @@ jobs:
6363
timeout-minutes: 10
6464

6565
steps:
66-
- name: Checkout
67-
uses: actions/[email protected]
66+
- name: Checkout
67+
uses: actions/[email protected]
6868

69-
- name: Setup CI
70-
uses: ./.github/actions/setup-android
69+
- name: Setup CI
70+
uses: ./.github/actions/setup-android
7171

72-
- name: Run ktlint
73-
run: ./gradlew setUserHome ktlintCheck --stacktrace
74-
env:
75-
GITHUB_USER: ${{ github.actor }}
76-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
- name: Run ktlint
73+
run: ./gradlew setUserHome ktlintCheck --stacktrace
74+
env:
75+
GITHUB_USER: ${{ github.actor }}
76+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7777

78-
- name: Upload SARIF
79-
uses: github/codeql-action/upload-sarif@v3
80-
if: success() || failure()
81-
with:
82-
sarif_file: shared/build/reports/ktlint
83-
category: ktlint
78+
- name: Upload SARIF
79+
uses: github/codeql-action/upload-sarif@v3
80+
if: success() || failure()
81+
with:
82+
sarif_file: shared/build/reports/ktlint
83+
category: ktlint
8484

8585
detekt:
8686
needs: files-changed
@@ -90,22 +90,22 @@ jobs:
9090
timeout-minutes: 10
9191

9292
steps:
93-
- name: Checkout
94-
uses: actions/[email protected]
95-
96-
- name: Setup CI
97-
uses: ./.github/actions/setup-android
98-
99-
- name: Run detekt
100-
run: ./gradlew detekt
101-
102-
- name: Upload SARIF
103-
uses: github/codeql-action/upload-sarif@v3
104-
if: success() || failure()
105-
with:
106-
sarif_file: build/reports/detekt/detekt.sarif
107-
category: detekt
108-
93+
- name: Checkout
94+
uses: actions/[email protected]
95+
96+
- name: Setup CI
97+
uses: ./.github/actions/setup-android
98+
99+
- name: Run detekt
100+
run: ./gradlew detekt
101+
102+
- name: Upload SARIF
103+
uses: github/codeql-action/upload-sarif@v3
104+
if: success() || failure()
105+
with:
106+
sarif_file: build/reports/detekt/detekt.sarif
107+
category: detekt
108+
109109
swiftlint:
110110
needs: files-changed
111111
if: ${{ needs.files-changed.outputs.ios == 'true' || needs.files-changed.outputs.shared == 'true' }}
@@ -120,26 +120,26 @@ jobs:
120120
- name: Setup Ruby
121121
uses: ruby/[email protected]
122122
with:
123-
ruby-version: '3.3.0'
123+
ruby-version: "3.3.0"
124124
bundler-cache: true
125-
working-directory: './iosHyperskillApp'
125+
working-directory: "./iosHyperskillApp"
126126

127127
- name: Cache Pods
128128
uses: actions/[email protected]
129129
id: cache-pods
130130
with:
131-
path: './iosHyperskillApp/Pods'
131+
path: "./iosHyperskillApp/Pods"
132132
key: ${{ runner.os }}-pods-${{ hashFiles('iosHyperskillApp/Podfile.lock') }}
133133
restore-keys: |
134134
${{ runner.os }}-pods-
135135
136136
- name: Install Pods
137137
if: steps.cache-pods.outputs.cache-hit != 'true'
138-
working-directory: './iosHyperskillApp'
138+
working-directory: "./iosHyperskillApp"
139139
run: bundle exec pod install
140140

141141
- name: Run SwiftLint
142-
working-directory: './iosHyperskillApp'
142+
working-directory: "./iosHyperskillApp"
143143
run: ./lint.sh
144144

145145
shared-unit-testing:
@@ -150,21 +150,21 @@ jobs:
150150
timeout-minutes: 30
151151

152152
steps:
153-
- name: Checkout
154-
uses: actions/[email protected]
155-
156-
- name: Setup CI
157-
id: setup
158-
uses: ./.github/actions/setup-android
159-
with:
160-
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
161-
162-
- name: Run unit tests
163-
run: ./gradlew shared:testDebugUnitTest
164-
env:
165-
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
166-
GITHUB_USER: ${{ github.actor }}
167-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
- name: Checkout
154+
uses: actions/[email protected]
155+
156+
- name: Setup CI
157+
id: setup
158+
uses: ./.github/actions/setup-android
159+
with:
160+
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
161+
162+
- name: Run unit tests
163+
run: ./gradlew shared:testDebugUnitTest
164+
env:
165+
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
166+
GITHUB_USER: ${{ github.actor }}
167+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168168

169169
android-unit-testing:
170170
needs: [files-changed, ktlint, detekt]
@@ -174,28 +174,28 @@ jobs:
174174
timeout-minutes: 30
175175

176176
steps:
177-
- name: Checkout
178-
uses: actions/[email protected]
179-
180-
- name: Setup CI
181-
id: setup
182-
uses: ./.github/actions/setup-android
183-
with:
184-
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
185-
186-
- name: Run unit tests
187-
run: ./gradlew androidHyperskillApp:testDebugUnitTest
188-
env:
189-
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
190-
GITHUB_USER: ${{ github.actor }}
191-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
177+
- name: Checkout
178+
uses: actions/[email protected]
179+
180+
- name: Setup CI
181+
id: setup
182+
uses: ./.github/actions/setup-android
183+
with:
184+
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
185+
186+
- name: Run unit tests
187+
run: ./gradlew androidHyperskillApp:testDebugUnitTest
188+
env:
189+
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
190+
GITHUB_USER: ${{ github.actor }}
191+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192192

193193
build-ios:
194194
needs: swiftlint
195195
name: Build iOS
196196
runs-on: macos-14
197197
timeout-minutes: 30
198-
198+
199199
steps:
200200
- name: Checkout
201201
uses: actions/[email protected]
@@ -207,10 +207,17 @@ jobs:
207207
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
208208

209209
- name: Build
210-
working-directory: './iosHyperskillApp'
210+
working-directory: "./iosHyperskillApp"
211211
run: bundle exec fastlane build install_pods:false
212212
env:
213213
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
214214
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
215215
GITHUB_USER: ${{ github.actor }}
216216
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
217+
218+
- name: Upload error log
219+
if: ${{ failure() }}
220+
uses: actions/upload-artifact@v4
221+
with:
222+
name: iosHyperskillApp-iosHyperskillApp.log
223+
path: /Users/runner/Library/Logs/gym/iosHyperskillApp-iosHyperskillApp.log

.github/workflows/ios_beta_deployment.yml

+7
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,10 @@ jobs:
6363
APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
6464
GITHUB_USER: ${{ github.actor }}
6565
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Upload error log
68+
if: ${{ failure() }}
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: iosHyperskillApp-iosHyperskillApp.log
72+
path: /Users/runner/Library/Logs/gym/iosHyperskillApp-iosHyperskillApp.log

.github/workflows/ios_release_deployment.yml

+32-25
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313
defaults:
1414
run:
1515
shell: bash
16-
16+
1717
jobs:
1818
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
1919
gradle-wrapper-validation:
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
uses: actions/[email protected]
25-
25+
2626
- name: Gradle Wrapper Validation
2727
uses: gradle/actions/wrapper-validation@v4
2828

@@ -35,26 +35,33 @@ jobs:
3535
timeout-minutes: 60
3636

3737
steps:
38-
- name: Checkout
39-
uses: actions/[email protected]
40-
41-
- name: Setup CI
42-
id: setup
43-
uses: ./.github/actions/setup-ios
44-
with:
45-
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
46-
google-cloud-storage-code-signing-certificates-key: ${{ secrets.GOOGLE_CLOUD_STORAGE_CODE_SIGNING_CERTIFICATES_KEY_CONTENT }}
47-
48-
- name: Submit a new Release Build to App Store Connect
49-
working-directory: './iosHyperskillApp'
50-
run: bundle exec fastlane release install_pods:false
51-
env:
52-
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
53-
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
54-
KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }}
55-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
56-
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
57-
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
58-
APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
59-
GITHUB_USER: ${{ github.actor }}
60-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
- name: Checkout
39+
uses: actions/[email protected]
40+
41+
- name: Setup CI
42+
id: setup
43+
uses: ./.github/actions/setup-ios
44+
with:
45+
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
46+
google-cloud-storage-code-signing-certificates-key: ${{ secrets.GOOGLE_CLOUD_STORAGE_CODE_SIGNING_CERTIFICATES_KEY_CONTENT }}
47+
48+
- name: Submit a new Release Build to App Store Connect
49+
working-directory: "./iosHyperskillApp"
50+
run: bundle exec fastlane release install_pods:false
51+
env:
52+
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
53+
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
54+
KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }}
55+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
56+
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
57+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
58+
APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
59+
GITHUB_USER: ${{ github.actor }}
60+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Upload error log
63+
if: ${{ failure() }}
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: iosHyperskillApp-iosHyperskillApp.log
67+
path: /Users/runner/Library/Logs/gym/iosHyperskillApp-iosHyperskillApp.log

.github/workflows/ios_unit_testing.yml

+24-17
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,27 @@ jobs:
2222
timeout-minutes: 60
2323

2424
steps:
25-
- name: Checkout
26-
uses: actions/[email protected]
27-
28-
- name: Setup CI
29-
id: setup
30-
uses: ./.github/actions/setup-ios
31-
with:
32-
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
33-
34-
- name: Run unit tests
35-
working-directory: './iosHyperskillApp'
36-
run: bundle exec fastlane run_unit_tests install_pods:false
37-
env:
38-
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
39-
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
40-
GITHUB_USER: ${{ github.actor }}
41-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Checkout
26+
uses: actions/[email protected]
27+
28+
- name: Setup CI
29+
id: setup
30+
uses: ./.github/actions/setup-ios
31+
with:
32+
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
33+
34+
- name: Run unit tests
35+
working-directory: "./iosHyperskillApp"
36+
run: bundle exec fastlane run_unit_tests install_pods:false
37+
env:
38+
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
39+
IS_GIT_CRYPT_UNLOCKED: ${{ steps.setup.outputs.is-git-crypt-unlocked }}
40+
GITHUB_USER: ${{ github.actor }}
41+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Upload error log
44+
if: ${{ failure() }}
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: iosHyperskillApp-iosHyperskillApp.log
48+
path: /Users/runner/Library/Logs/gym/iosHyperskillApp-iosHyperskillApp.log

0 commit comments

Comments
 (0)