Skip to content

Commit 1988e17

Browse files
committed
ci: refactor and add caching, use macOS-26 image for iOS
1 parent ac4efd6 commit 1988e17

13 files changed

Lines changed: 221 additions & 201 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Prepare Android environment
2+
description: Prepare Android environment and set up the project
3+
4+
inputs:
5+
free-disk-space:
6+
description: 'Whether to free disk space on the runner'
7+
required: false
8+
default: 'true'
9+
10+
run-yarn-build:
11+
description: 'Whether to run yarn build'
12+
required: false
13+
default: 'true'
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Validate Gradle Wrapper
19+
uses: gradle/actions/wrapper-validation@6f229686ee4375cc4a86b2514c89bac4930e82c4 # v5
20+
21+
- name: Setup Java
22+
uses: actions/setup-java@5d7b2146334bacf88728daaa70414a99f5164e0f # v5
23+
with:
24+
distribution: 'zulu'
25+
java-version: '17'
26+
27+
- name: Free Disk Space (Ubuntu)
28+
if: inputs.free-disk-space == 'true'
29+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
30+
with:
31+
tool-cache: false
32+
33+
android: false
34+
dotnet: true
35+
haskell: true
36+
large-packages: true
37+
docker-images: true
38+
swap-storage: true
39+
40+
- name: Build packages
41+
if: inputs.run-yarn-build == 'true'
42+
run: yarn build
43+
shell: bash
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Prepare iOS environment
2+
description: Prepare iOS environment and set up the project
3+
4+
inputs:
5+
run-yarn-build:
6+
description: 'Whether to run yarn build'
7+
required: false
8+
default: 'true'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Use appropriate Xcode version
14+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
15+
with:
16+
xcode-version: '26'
17+
18+
- name: Setup Ruby
19+
uses: ruby/setup-ruby@5dd816ae0186f20dfa905997a64104db9a8221c7 # v1.280.0
20+
with:
21+
ruby-version: '3.2'
22+
bundler-cache: true
23+
24+
- name: Build packages
25+
if: inputs.run-yarn-build == 'true'
26+
run: yarn build
27+
shell: bash

.github/actions/setup/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Setup
22
description: Setup Node.js and install dependencies
33

4+
inputs:
5+
restore-turbo-cache:
6+
description: 'Whether to restore the Turbo cache'
7+
required: false
8+
default: 'true'
9+
410
runs:
511
using: composite
612
steps:
@@ -10,7 +16,12 @@ runs:
1016
node-version: 'lts/*'
1117
cache: 'yarn'
1218

13-
- name: Restore turbo cache
19+
- name: Install dependencies
20+
run: yarn install
21+
shell: bash
22+
23+
- name: Restore Turbo cache
24+
if: inputs.restore-turbo-cache == 'true'
1425
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
1526
with:
1627
path: |
@@ -20,7 +31,3 @@ runs:
2031
key: ${{ runner.os }}-turbo-${{ hashFiles('.turbo', '**/.turbo') }}
2132
restore-keys: |
2233
${{ runner.os }}-turbo-
23-
24-
- name: Install dependencies
25-
run: yarn install
26-
shell: bash

.github/workflows/ci.yml

Lines changed: 115 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -30,74 +30,53 @@ jobs:
3030
- name: Typecheck files
3131
run: yarn typecheck
3232

33-
- name: Test Brownfield CLI
33+
- name: Test Brownfield CLI (version)
3434
run: |
3535
yarn workspace @callstack/react-native-brownfield brownfield --version
3636
3737
android:
38-
name: 'Android: integrated tester & integration workflow with CLI'
38+
name: Android road tests
3939
runs-on: ubuntu-latest
4040
needs: build-lint
4141

4242
steps:
4343
- name: Checkout
4444
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
4545

46-
- name: Validate Gradle Wrapper
47-
uses: gradle/actions/wrapper-validation@6f229686ee4375cc4a86b2514c89bac4930e82c4 # v5
48-
49-
- name: Setup Java
50-
uses: actions/setup-java@5d7b2146334bacf88728daaa70414a99f5164e0f # v5
51-
with:
52-
distribution: 'zulu'
53-
java-version: '17'
54-
55-
- name: Free Disk Space (Ubuntu)
56-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
57-
with:
58-
tool-cache: false
59-
60-
android: false
61-
dotnet: true
62-
haskell: true
63-
large-packages: true
64-
docker-images: true
65-
swap-storage: true
66-
67-
- name: Setup Node.js
68-
uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6
69-
with:
70-
node-version: 'lts/*'
71-
cache: 'yarn'
72-
73-
- name: Install dependencies
74-
run: yarn install
46+
- name: Setup
47+
uses: ./.github/actions/setup
7548

76-
- name: Build packages
77-
run: yarn build
49+
- name: Prepare Android environment
50+
uses: ./.github/actions/prepare-android
7851

79-
- name: Restore android build cache
52+
- name: Restore Android build cache
8053
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
8154
with:
8255
path: |
8356
apps/TesterIntegrated/kotlin/build
8457
apps/TesterIntegrated/kotlin/app/.cxx
8558
apps/TesterIntegrated/kotlin/app/build
86-
key: ${{ runner.os }}-tester-android-build-${{ github.sha }}
59+
apps/RNApp/android/build
60+
apps/RNApp/android/app/.cxx
61+
apps/RNApp/android/app/build
62+
apps/AndroidApp/build
63+
apps/AndroidApp/app/build
64+
apps/AndroidApp/app/.cxx
65+
key: ${{ runner.os }}-android-build-road-tests-${{ github.sha }}
8766
restore-keys: |
88-
${{ runner.os }}-tester-android-build-
67+
${{ runner.os }}-android-build-road-tests-
8968
9069
- name: Restore Gradle cache
9170
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
9271
with:
9372
path: |
9473
~/.gradle/caches
9574
~/.gradle/wrapper
96-
key: ${{ runner.os }}-tester-integrated-android-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
75+
key: ${{ runner.os }}-android-ci-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
9776
restore-keys: |
98-
${{ runner.os }}-tester-integrated-android-gradle-
77+
${{ runner.os }}-android-ci-gradle-
9978
100-
# == IntegratedTester ==
79+
# == TesterIntegrated ==
10180

10281
- name: Generate Brownie stores
10382
run: yarn run brownfield:codegen
@@ -129,65 +108,131 @@ jobs:
129108
run: |
130109
yarn run build:example:android-consumer
131110
132-
ios:
133-
name: Integrated tester iOS App
134-
runs-on: macos-latest
111+
ios-tester-integrated:
112+
name: iOS road tests (TesterIntegrated)
113+
runs-on: macos-26
135114
needs: build-lint
136115

116+
env: &ios_env
117+
USE_CCACHE: 1
118+
CCACHE_DIR: ${{ github.workspace }}/.ios_ccache
119+
CCACHE_BASEDIR: ${{ github.workspace }}
120+
CCACHE_COMPRESS: '1'
121+
137122
steps:
138123
- name: Checkout
139124
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
140125

141-
- name: Use appropriate Xcode version
142-
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
143-
with:
144-
xcode-version: '16'
126+
- name: Setup
127+
uses: ./.github/actions/setup
145128

146-
- name: Setup Node.js
147-
uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6
148-
with:
149-
node-version: 'lts/*'
150-
cache: 'yarn'
129+
- name: Prepare iOS environment
130+
uses: ./.github/actions/prepare-ios
151131

152-
- name: Setup Ruby
153-
uses: ruby/setup-ruby@5dd816ae0186f20dfa905997a64104db9a8221c7 # v1.280.0
154-
with:
155-
ruby-version: '3.2'
156-
bundler-cache: true
132+
- name: Install ccache
133+
run: brew install ccache
157134

158-
- name: Install dependencies
159-
run: yarn install
135+
- name: Enable ccache
136+
run: echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
160137

161-
- name: Build packages
162-
run: yarn build
138+
- name: Restore TesterIntegrated ccache
139+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
140+
with:
141+
path: |
142+
.ios_ccache
143+
key: ${{ runner.os }}-tester-integrated-ios-ccache-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock', 'apps/TesterIntegrated/swift/SwiftExample.xcodeproj/project.pbxproj') }}
144+
restore-keys: |
145+
${{ runner.os }}-tester-integrated-ios-ccache-
163146
164-
- name: Restore Pods cache
147+
# == TesterIntegrated ==
148+
149+
- name: Restore Pods cache (TesterIntegrated)
165150
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
166151
with:
167152
path: |
168153
apps/TesterIntegrated/swift/Pods
169-
key: ${{ runner.os }}-tester-ios-pods-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock') }}
154+
key: ${{ runner.os }}-tester-integrated-ios-pods-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock') }}
170155
restore-keys: |
171-
${{ runner.os }}-tester-ios-pods-
156+
${{ runner.os }}-tester-integrated-ios-pods-
172157
173-
- name: Install pods
158+
- name: Install pods (TesterIntegrated)
174159
run: |
175160
cd apps/TesterIntegrated/swift
176161
pod install
177162
178-
# == IntegratedTester ==
163+
- name: Restore DerivedData cache (TesterIntegrated)
164+
uses: actions/cache@v5
165+
with:
166+
path: apps/TesterIntegrated/swift/build
167+
key: ${{ runner.os }}-ios-tester-integrated-derived-data-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock', 'apps/TesterIntegrated/swift/SwiftExample.xcodeproj/project.pbxproj') }}
168+
restore-keys: |
169+
${{ runner.os }}-ios-tester-integrated-derived-data-
179170
180171
- name: Build integrated iOS tester app
181172
run: |
182173
yarn run build:tester-integrated:ios
183174
175+
# ==============
176+
177+
- name: Report ccache usage
178+
run: ccache -s
179+
180+
ios-rnapp-appleapp:
181+
name: iOS road tests (RNApp & AppleApp)
182+
runs-on: macos-26
183+
needs: build-lint
184+
185+
env: *ios_env
186+
187+
steps:
188+
- name: Checkout
189+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
190+
191+
- name: Setup
192+
uses: ./.github/actions/setup
193+
194+
- name: Prepare iOS environment
195+
uses: ./.github/actions/prepare-ios
196+
197+
- name: Install ccache
198+
run: brew install ccache
199+
200+
- name: Enable ccache
201+
run: echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
202+
203+
- name: Restore RNApp & AppleApp ccache
204+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
205+
with:
206+
path: |
207+
.ios_ccache
208+
key: ${{ runner.os }}-rnapp-appleapp-ios-ccache-${{ hashFiles('apps/RNApp/ios/Podfile.lock', 'apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj', 'apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj') }}
209+
restore-keys: |
210+
${{ runner.os }}-rnapp-appleapp-ios-ccache-
211+
184212
# == RNApp ==
185213

214+
- name: Restore Pods cache (RNApp)
215+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
216+
with:
217+
path: |
218+
apps/RNApp/ios/Pods
219+
key: ${{ runner.os }}-rnapp-ios-pods-${{ hashFiles('apps/RNApp/ios/Podfile.lock') }}
220+
restore-keys: |
221+
${{ runner.os }}-rnapp-ios-pods-
222+
186223
- name: Install pods (RNApp)
187224
run: |
188225
cd apps/RNApp/ios
189226
pod install
190227
228+
- name: Restore DerivedData cache (RNApp)
229+
uses: actions/cache@v5
230+
with:
231+
path: apps/RNApp/ios/build
232+
key: ${{ runner.os }}-ios-rnapp-derived-data-${{ hashFiles('apps/RNApp/ios/Podfile.lock', 'apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj') }}
233+
restore-keys: |
234+
${{ runner.os }}-ios-rnapp-derived-data-
235+
191236
- name: Package iOS framework with the Brownfield CLI
192237
run: |
193238
cd apps/RNApp
@@ -198,3 +243,8 @@ jobs:
198243
- name: Build Brownfield iOS native app
199244
run: |
200245
yarn run build:example:ios-consumer
246+
247+
# ==============
248+
249+
- name: Report ccache usage
250+
run: ccache -s

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,13 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
25-
with:
26-
fetch-depth: 0 # Not needed if lastUpdated is not enabled
25+
2726
- name: Setup
2827
uses: ./.github/actions/setup
2928

3029
- name: Setup Pages
3130
uses: actions/configure-pages@d5606572c479bee637007364c6b4800ac4fc8573 # v5
3231

33-
- name: Install dependencies
34-
working-directory: docs
35-
run: yarn install
36-
3732
- name: Build with Rspress
3833
working-directory: docs
3934
run: |

0 commit comments

Comments
 (0)