Skip to content

Commit da5340e

Browse files
chrfalchclaude
andcommitted
CI: build only the slices a caller needs in the prebuild-ios workflows
Add an optional `slices` input to prebuild-ios-dependencies.yml and prebuild-ios-core.yml, driving their build matrix from it. It defaults to the full platform set, so existing callers (test-all.yml, releases) are unchanged. The three SwiftPM iOS e2e workflows only ever compile for the iOS simulator, so they now request `["ios-simulator"]` from both prebuild workflows — cutting the dependencies matrix from 8 slices to 1 and the core matrix from 3 to 1 (per flavor), which is the dominant cost of those e2e runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 387bc99 commit da5340e

5 files changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/prebuild-ios-core.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
type: boolean
1414
required: false
1515
default: false
16+
slices:
17+
description: 'JSON array of Apple platform slices to build. Defaults to the full set; callers that only consume a subset (e.g. a simulator-only e2e build) can pass fewer to save time.'
18+
type: string
19+
required: false
20+
default: '["ios", "ios-simulator", "mac-catalyst"]'
1621

1722
jobs:
1823
build-rn-slice:
@@ -21,7 +26,7 @@ jobs:
2126
fail-fast: false
2227
matrix:
2328
flavor: ['Debug', 'Release']
24-
slice: ['ios', 'ios-simulator', 'mac-catalyst']
29+
slice: ${{ fromJSON(inputs.slices) }}
2530
steps:
2631
- name: Checkout
2732
uses: actions/checkout@v6

.github/workflows/prebuild-ios-dependencies.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Prebuild iOS Dependencies
22

33
on:
44
workflow_call: # this directive allow us to call this workflow from other workflows
5+
inputs:
6+
slices:
7+
description: 'JSON array of Apple platform slices to build. Defaults to the full set; callers that only consume a subset (e.g. a simulator-only e2e build) can pass fewer to save time.'
8+
type: string
9+
required: false
10+
default: '["ios", "ios-simulator", "macos", "mac-catalyst", "tvos", "tvos-simulator", "xros", "xros-simulator"]'
511

612
jobs:
713
prepare_workspace:
@@ -51,17 +57,7 @@ jobs:
5157
fail-fast: false
5258
matrix:
5359
flavor: ['Debug', 'Release']
54-
slice:
55-
[
56-
'ios',
57-
'ios-simulator',
58-
'macos',
59-
'mac-catalyst',
60-
'tvos',
61-
'tvos-simulator',
62-
'xros',
63-
'xros-simulator',
64-
]
60+
slice: ${{ fromJSON(inputs.slices) }}
6561
steps:
6662
- name: Checkout
6763
uses: actions/checkout@v6

.github/workflows/test-ios-spm-helloworld.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
jobs:
2222
prebuild_apple_dependencies:
2323
uses: ./.github/workflows/prebuild-ios-dependencies.yml
24+
with:
25+
# e2e only compiles for the iOS simulator — no need for device/catalyst/tv/xr slices.
26+
slices: '["ios-simulator"]'
2427
secrets: inherit
2528

2629
prebuild_react_native_core:
@@ -29,6 +32,7 @@ jobs:
2932
uses: ./.github/workflows/prebuild-ios-core.yml
3033
with:
3134
use-hermes-prebuilt: ${{ !endsWith(github.ref_name, '-stable') }}
35+
slices: '["ios-simulator"]'
3236
secrets: inherit
3337

3438
set_flavors:

.github/workflows/test-ios-spm-newapp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
jobs:
2222
prebuild_apple_dependencies:
2323
uses: ./.github/workflows/prebuild-ios-dependencies.yml
24+
with:
25+
# e2e only compiles for the iOS simulator — no need for device/catalyst/tv/xr slices.
26+
slices: '["ios-simulator"]'
2427
secrets: inherit
2528

2629
prebuild_react_native_core:
@@ -29,6 +32,7 @@ jobs:
2932
uses: ./.github/workflows/prebuild-ios-core.yml
3033
with:
3134
use-hermes-prebuilt: ${{ !endsWith(github.ref_name, '-stable') }}
35+
slices: '["ios-simulator"]'
3236
secrets: inherit
3337

3438
# Produces the `react-native-package` artifact (a local react-native .tgz) the

.github/workflows/test-ios-spm-rntester.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
jobs:
2222
prebuild_apple_dependencies:
2323
uses: ./.github/workflows/prebuild-ios-dependencies.yml
24+
with:
25+
# e2e only compiles for the iOS simulator — no need for device/catalyst/tv/xr slices.
26+
slices: '["ios-simulator"]'
2427
secrets: inherit
2528

2629
prebuild_react_native_core:
@@ -29,6 +32,7 @@ jobs:
2932
uses: ./.github/workflows/prebuild-ios-core.yml
3033
with:
3134
use-hermes-prebuilt: ${{ !endsWith(github.ref_name, '-stable') }}
35+
slices: '["ios-simulator"]'
3236
secrets: inherit
3337

3438
set_flavors:

0 commit comments

Comments
 (0)