Repository navigation
Expand file tree
/
Copy pathmicrosoft-react-native-test-app-integration.yml
More file actions
94 lines (79 loc) · 3.25 KB
/
Copy pathmicrosoft-react-native-test-app-integration.yml
File metadata and controls
94 lines (79 loc) · 3.25 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
name: Test react-native-test-app integration
on:
workflow_call:
jobs:
react-native-test-app-integration:
name: "Test react-native-test-app integration"
runs-on: macos-26
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
clean: true
- name: Setup toolchain
uses: ./.github/actions/microsoft-setup-toolchain
with:
node-version: '22'
platform: 'macos'
- name: Install npm dependencies
run: yarn install
- name: Build community CLI plugin
run: |
yarn build
# yarn build rewrites package.json exports; restore them
git checkout -- packages/*/package.json
- name: Build react-native-macos-init
working-directory: packages/react-native-macos-init
run: yarn build
- name: Export versions
id: versions
run: node .github/scripts/export-versions.mts
- name: Pack local react-native-macos
working-directory: packages/react-native
run: |
set -eox pipefail
yarn pack -o ${{ runner.temp }}/react-native-macos.tgz
- name: Clone react-native-test-app
run: |
git clone --filter=blob:none --progress https://github.com/microsoft/react-native-test-app.git
- name: Configure react-native-test-app dependencies
working-directory: react-native-test-app/packages/example-macos
run: |
node ../app/scripts/internal/set-react-version.mts ${{ steps.versions.outputs.react_native_version }} --overrides '{ "react-native-macos": "file:${{ runner.temp }}/react-native-macos.tgz" }'
- name: Pin @types/react to avoid duplicate react-native-macos
working-directory: react-native-test-app
run: |
# The test app tree carries both @types/react 19.1.x (example-macos)
# and 19.2.x (app), both satisfying react-native-macos's peer. Under
# Yarn's pnpm nodeLinker this virtualizes react-native-macos twice and
# trips the metro duplicate-dependency checker. Pin to a single version.
node -e "
const fs = require('fs');
const root = JSON.parse(fs.readFileSync('package.json', 'utf8'));
root.resolutions = root.resolutions || {};
root.resolutions['@types/react'] = '~19.1.0';
fs.writeFileSync('package.json', JSON.stringify(root, null, 2) + '\n');
"
- name: Install dependencies in test app
working-directory: react-native-test-app
env:
YARN_ENABLE_HARDENED_MODE: 0
YARN_NPM_MINIMAL_AGE_GATE: 0
run: |
set -eo pipefail
yarn --no-immutable
- name: Bundle JavaScript
working-directory: react-native-test-app/packages/example-macos
run: |
yarn build:macos || yarn build:macos
- name: Install Pods
working-directory: react-native-test-app/packages/example-macos
run: |
rm -f macos/Podfile.lock
pod install --project-directory=macos
- name: Build test app
working-directory: react-native-test-app/packages/example-macos
run: |
../../scripts/xcodebuild.sh macos/Example.xcworkspace build