Skip to content

Commit 2a9ed3c

Browse files
committed
Move workflows to separate files
1 parent 55ca895 commit 2a9ed3c

4 files changed

Lines changed: 247 additions & 218 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build RNTester
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-test-rntester:
8+
name: "${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.engine }}"
9+
runs-on: macos-15
10+
timeout-minutes: 90
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform: [macos, ios, xros]
15+
arch: [oldarch, newarch]
16+
engine: [jsc, hermes]
17+
include:
18+
# Platform-specific properties
19+
- platform: macos
20+
sdk: macosx
21+
scheme: RNTester-macOS
22+
packager_platform: macos
23+
- platform: ios
24+
sdk: iphonesimulator
25+
scheme: RNTester
26+
packager_platform: ios
27+
- platform: xros
28+
sdk: xrsimulator
29+
scheme: RNTester-visionOS
30+
packager_platform: ios
31+
# Architecture-specific properties
32+
- arch: oldarch
33+
new_arch_enabled: '0'
34+
- arch: newarch
35+
new_arch_enabled: '1'
36+
- engine: jsc
37+
use_hermes: '0'
38+
- engine: hermes
39+
use_hermes: '1'
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
filter: blob:none
45+
fetch-depth: 0
46+
47+
- name: Setup toolchain
48+
uses: ./.github/actions/microsoft-setup-toolchain
49+
with:
50+
node-version: '23'
51+
platform: ${{ matrix.platform }}
52+
53+
- name: Install npm dependencies
54+
run: yarn install
55+
56+
- name: Install Pods
57+
working-directory: packages/rn-tester
58+
env:
59+
RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }}
60+
USE_HERMES: ${{ matrix.use_hermes }}
61+
run: |
62+
set -eox pipefail
63+
bundle install
64+
bundle exec pod install --verbose
65+
66+
- name: Build ${{ matrix.scheme }}
67+
env:
68+
CCACHE_DISABLE: 1
69+
run: |
70+
set -eox pipefail
71+
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ matrix.sdk }} Debug ${{ matrix.scheme }} build

.github/workflows/microsoft-pr.yml

Lines changed: 4 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -121,230 +121,16 @@ jobs:
121121
run: yarn format-check
122122

123123
build-test-rntester:
124-
name: "Build RNTester - ${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.engine }}"
124+
name: "Build RNTester"
125125
permissions: {}
126-
runs-on: macos-15
127-
timeout-minutes: 90
128-
strategy:
129-
fail-fast: false
130-
matrix:
131-
platform: [macos, ios, xros]
132-
arch: [oldarch, newarch]
133-
engine: [jsc, hermes]
134-
include:
135-
# Platform-specific properties
136-
- platform: macos
137-
sdk: macosx
138-
scheme: RNTester-macOS
139-
packager_platform: macos
140-
- platform: ios
141-
sdk: iphonesimulator
142-
scheme: RNTester
143-
packager_platform: ios
144-
- platform: xros
145-
sdk: xrsimulator
146-
scheme: RNTester-visionOS
147-
packager_platform: ios
148-
# Architecture-specific properties
149-
- arch: oldarch
150-
new_arch_enabled: '0'
151-
- arch: newarch
152-
new_arch_enabled: '1'
153-
- engine: jsc
154-
use_hermes: '0'
155-
- engine: hermes
156-
use_hermes: '1'
157-
158-
steps:
159-
- uses: actions/checkout@v4
160-
with:
161-
filter: blob:none
162-
fetch-depth: 0
163-
164-
- name: Setup toolchain
165-
uses: ./.github/actions/microsoft-setup-toolchain
166-
with:
167-
node-version: '23'
168-
platform: ${{ matrix.platform }}
169-
170-
- name: Install npm dependencies
171-
run: yarn install
172-
173-
- name: Install Pods
174-
working-directory: packages/rn-tester
175-
env:
176-
RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }}
177-
USE_HERMES: ${{ matrix.use_hermes }}
178-
run: |
179-
set -eox pipefail
180-
bundle install
181-
bundle exec pod install --verbose
182-
183-
- name: Build ${{ matrix.scheme }}
184-
env:
185-
CCACHE_DISABLE: 1
186-
run: |
187-
set -eox pipefail
188-
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ matrix.sdk }} Debug ${{ matrix.scheme }} build
126+
uses: ./.github/workflows/microsoft-build-rntester.yml
189127

190128
test-react-native-macos-init:
191129
name: "Test react-native-macos init"
192130
permissions: {}
193-
runs-on: macos-15
194-
timeout-minutes: 60
195-
steps:
196-
- uses: actions/checkout@v4
197-
with:
198-
filter: blob:none
199-
fetch-depth: 0
200-
lfs: false
201-
clean: true
202-
203-
- name: Setup toolchain
204-
uses: ./.github/actions/microsoft-setup-toolchain
205-
with:
206-
node-version: '23'
207-
platform: 'macos'
208-
209-
- name: Install npm dependencies
210-
run: yarn install
211-
212-
- name: Build community CLI plugin
213-
run: yarn build
214-
215-
- name: Build react-native-macos-init
216-
working-directory: packages/react-native-macos-init
217-
run: yarn build
218-
219-
- name: Start Verdaccio server
220-
run: |
221-
set -euo pipefail
222-
nohup npx verdaccio --config .ado/verdaccio/config.yaml >/dev/null 2>&1 &
223-
echo $! > $RUNNER_TEMP/verdaccio.pid
224-
- name: Wait for Verdaccio to be ready
225-
run: node .ado/scripts/waitForVerdaccio.mjs http://localhost:4873
226-
227-
- name: Configure npm for Verdaccio
228-
run: .ado/scripts/verdaccio.sh init
229-
230-
- name: Publish to Verdaccio
231-
run: .ado/scripts/verdaccio.sh publish --branch origin/${{ github.base_ref }}
232-
- name: Stop Verdaccio
233-
if: always()
234-
run: |
235-
if [ -f "$RUNNER_TEMP/verdaccio.pid" ]; then
236-
kill "$(cat $RUNNER_TEMP/verdaccio.pid)" || true
237-
fi
238-
239-
- name: Export versions
240-
run: node .ado/scripts/export-versions.mjs
241-
242-
- name: Initialize new project
243-
run: |
244-
set -eox pipefail
245-
npx --yes @react-native-community/cli init testcli --version $(cat .react_native_version) --skip-install
246-
working-directory: ${{ runner.temp }}
247-
248-
- name: Install dependencies in new project
249-
working-directory: ${{ runner.temp }}/testcli
250-
run: |
251-
set -eox pipefail
252-
yarn install --mode=update-lockfile
253-
yarn install
254-
255-
- name: Apply macOS template
256-
working-directory: ${{ runner.temp }}/testcli
257-
run: |
258-
set -eox pipefail
259-
${{ github.workspace }}/.ado/scripts/verdaccio.sh configure
260-
node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --version latest --overwrite --prerelease
261-
pod install --project-directory=macos
262-
263-
- name: Build macOS app
264-
working-directory: ${{ runner.temp }}/testcli
265-
run: |
266-
set -eox pipefail
267-
npx react-native build-macos
131+
uses: ./.github/workflows/microsoft-test-react-native-macos-init.yml
268132

269133
react-native-test-app-integration:
270134
name: "Test react-native-test-app integration"
271135
permissions: {}
272-
runs-on: macos-15
273-
timeout-minutes: 60
274-
steps:
275-
- uses: actions/checkout@v4
276-
with:
277-
filter: blob:none
278-
fetch-depth: 0
279-
clean: true
280-
281-
- name: Setup toolchain
282-
uses: ./.github/actions/microsoft-setup-toolchain
283-
with:
284-
node-version: '23'
285-
platform: 'macos'
286-
287-
- name: Install npm dependencies
288-
run: yarn install
289-
290-
- name: Build community CLI plugin
291-
run: yarn build
292-
293-
- name: Build react-native-macos-init
294-
working-directory: packages/react-native-macos-init
295-
run: yarn build
296-
297-
- name: Start Verdaccio server
298-
run: |
299-
set -euo pipefail
300-
nohup npx verdaccio --config .ado/verdaccio/config.yaml >/dev/null 2>&1 &
301-
echo $! > $RUNNER_TEMP/verdaccio.pid
302-
- name: Wait for Verdaccio to be ready
303-
run: node .ado/scripts/waitForVerdaccio.mjs http://localhost:4873
304-
305-
- name: Configure npm for Verdaccio
306-
run: .ado/scripts/verdaccio.sh init
307-
308-
- name: Publish to Verdaccio
309-
run: .ado/scripts/verdaccio.sh publish --branch origin/${{ github.base_ref }}
310-
- name: Stop Verdaccio
311-
if: always()
312-
run: |
313-
if [ -f "$RUNNER_TEMP/verdaccio.pid" ]; then
314-
kill "$(cat $RUNNER_TEMP/verdaccio.pid)" || true
315-
fi
316-
317-
- name: Clone react-native-test-app
318-
run: |
319-
git clone --filter=blob:none --progress https://github.com/microsoft/react-native-test-app.git
320-
321-
- name: Export versions
322-
run: node .ado/scripts/export-versions.mjs
323-
324-
- name: Configure react-native-test-app dependencies
325-
working-directory: react-native-test-app
326-
run: |
327-
npm run set-react-version $(cat ${{ github.workspace }}/.react_native_version) -- --overrides '{ "react-native-macos": "1000.0.0" }'
328-
329-
- name: Install dependencies in test app
330-
working-directory: react-native-test-app
331-
run: |
332-
set -eo pipefail
333-
${{ github.workspace }}/.ado/scripts/verdaccio.sh configure
334-
yarn --no-immutable
335-
336-
- name: Bundle JavaScript
337-
working-directory: react-native-test-app/example
338-
run: |
339-
yarn build:macos || yarn build:macos
340-
341-
- name: Install Pods
342-
working-directory: react-native-test-app/example
343-
run: |
344-
rm -f macos/Podfile.lock
345-
pod install --project-directory=macos
346-
347-
- name: Build test app
348-
working-directory: react-native-test-app/example
349-
run: |
350-
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build
136+
uses: ./.github/workflows/microsoft-react-native-test-app-integration.yml
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Test react-native-test-app integration
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
react-native-test-app-integration:
8+
name: "Test react-native-test-app integration"
9+
runs-on: macos-15
10+
timeout-minutes: 60
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
filter: blob:none
15+
fetch-depth: 0
16+
clean: true
17+
18+
- name: Setup toolchain
19+
uses: ./.github/actions/microsoft-setup-toolchain
20+
with:
21+
node-version: '23'
22+
platform: 'macos'
23+
24+
- name: Install npm dependencies
25+
run: yarn install
26+
27+
- name: Build community CLI plugin
28+
run: yarn build
29+
30+
- name: Build react-native-macos-init
31+
working-directory: packages/react-native-macos-init
32+
run: yarn build
33+
34+
- name: Start Verdaccio server
35+
run: |
36+
set -euo pipefail
37+
nohup npx --yes verdaccio --config .ado/verdaccio/config.yaml >/dev/null 2>&1 &
38+
echo $! > $RUNNER_TEMP/verdaccio.pid
39+
- name: Wait for Verdaccio to be ready
40+
run: node .ado/scripts/waitForVerdaccio.mjs http://localhost:4873
41+
42+
- name: Configure npm for Verdaccio
43+
run: .ado/scripts/verdaccio.sh init
44+
45+
- name: Publish to Verdaccio
46+
run: .ado/scripts/verdaccio.sh publish --branch origin/${{ github.base_ref }}
47+
48+
- name: Clone react-native-test-app
49+
run: |
50+
git clone --filter=blob:none --progress https://github.com/microsoft/react-native-test-app.git
51+
52+
- name: Export versions
53+
run: node .ado/scripts/export-versions.mjs
54+
55+
- name: Configure react-native-test-app dependencies
56+
working-directory: react-native-test-app
57+
run: |
58+
npm run set-react-version $(cat ${{ github.workspace }}/.react_native_version) -- --overrides '{ "react-native-macos": "1000.0.0" }'
59+
60+
- name: Install dependencies in test app
61+
working-directory: react-native-test-app
62+
run: |
63+
set -eo pipefail
64+
${{ github.workspace }}/.ado/scripts/verdaccio.sh configure
65+
yarn --no-immutable
66+
67+
- name: Bundle JavaScript
68+
working-directory: react-native-test-app/example
69+
run: |
70+
yarn build:macos || yarn build:macos
71+
72+
- name: Install Pods
73+
working-directory: react-native-test-app/example
74+
run: |
75+
rm -f macos/Podfile.lock
76+
pod install --project-directory=macos
77+
78+
- name: Build test app
79+
working-directory: react-native-test-app/example
80+
run: |
81+
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build
82+
83+
- name: Stop Verdaccio
84+
if: always()
85+
run: |
86+
if [ -f "$RUNNER_TEMP/verdaccio.pid" ]; then
87+
kill "$(cat $RUNNER_TEMP/verdaccio.pid)" || true
88+
fi

0 commit comments

Comments
 (0)