Skip to content

Commit 9945e86

Browse files
authored
ci: fix RNTA integration pipeline (#2241)
1 parent fd1bc5c commit 9945e86

13 files changed

+191
-254
lines changed

.ado/apple-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ stages:
3232
dependsOn: []
3333
jobs:
3434
- template: /.ado/jobs/test-react-native-macos-init.yml@self
35-
#- template: /.ado/jobs/react-native-test-app-integration.yml@self
35+
- template: /.ado/jobs/react-native-test-app-integration.yml@self

.ado/jobs/build-test-rntester.yml

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ parameters:
22
- name: appleBuildMatrix
33
type: object
44
default:
5-
- name: macos_oldarch_jsc
5+
- name: macos_oldarch_jsc
66
friendly_name: 'macOS, Old Arch, JSC'
77
sdk: macosx
88
scheme: RNTester-macOS
@@ -30,7 +30,7 @@ parameters:
3030
# packager_platform: 'macos'
3131
# new_arch_enabled: '1'
3232
# use_hermes: '1'
33-
- name: ios_oldarch_jsc
33+
- name: ios_oldarch_jsc
3434
friendly_name: 'iOS, Old Arch, JSC'
3535
sdk: iphonesimulator
3636
scheme: RNTester
@@ -58,7 +58,7 @@ parameters:
5858
# packager_platform: 'ios'
5959
# new_arch_enabled: '1'
6060
# use_hermes: '1'
61-
- name: xros_oldarch_jsc
61+
- name: xros_oldarch_jsc
6262
friendly_name: 'xrOS, Old Arch, JSC'
6363
sdk: xrsimulator
6464
scheme: RNTester-visionOS
@@ -89,88 +89,77 @@ parameters:
8989

9090
jobs:
9191
- ${{ each slice in parameters.appleBuildMatrix }}:
92-
- job: ${{ slice.name }}
93-
displayName: ${{ slice.friendly_name }}
94-
pool:
95-
vmImage: $(vmImageApple)
96-
timeoutInMinutes: 90
97-
cancelTimeoutInMinutes: 5
98-
steps:
92+
- job: ${{ slice.name }}
93+
displayName: ${{ slice.friendly_name }}
94+
pool:
95+
vmImage: $(vmImageApple)
96+
timeoutInMinutes: 90
97+
cancelTimeoutInMinutes: 5
98+
steps:
9999
- template: /.ado/templates/apple-tools-setup.yml@self
100100

101101
- ${{ if in(slice.sdk, 'xros', 'xrsimulator') }}:
102-
- task: CmdLine@2
103-
displayName: Download visionOS SDDK
104-
inputs:
105-
script: |
106-
set -eox pipefail
107-
# https://github.com/actions/runner-images/issues/10559
108-
sudo xcodebuild -runFirstLaunch
109-
sudo xcrun simctl list
110-
sudo xcodebuild -downloadPlatform visionOS
111-
sudo xcodebuild -runFirstLaunch
112-
113-
- task: CmdLine@2
114-
displayName: yarn install
115-
inputs:
116-
script: |
102+
- script: |
117103
set -eox pipefail
118-
yarn install --immutable
104+
# https://github.com/actions/runner-images/issues/10559
105+
sudo xcodebuild -runFirstLaunch
106+
sudo xcrun simctl list
107+
sudo xcodebuild -downloadPlatform visionOS
108+
sudo xcodebuild -runFirstLaunch
109+
displayName: Download visionOS SDK
119110
120-
- task: CmdLine@2
121-
displayName: pod install
122-
inputs:
123-
script: |
124-
set -eox pipefail
125-
cd packages/rn-tester
126-
bundle install
127-
bundle exec pod install --verbose
111+
- script: |
112+
yarn install
113+
displayName: Install npm dependencies
114+
115+
- script: |
116+
set -eox pipefail
117+
bundle install
118+
bundle exec pod install --verbose
128119
env:
129120
RCT_NEW_ARCH_ENABLED: ${{ slice.new_arch_enabled }}
130121
USE_HERMES: ${{ slice.use_hermes }}
122+
workingDirectory: packages/rn-tester
123+
displayName: Install Pods
131124
132-
- task: CmdLine@2
133-
displayName: Build ${{ slice.scheme }}
134-
inputs:
135-
script: |
136-
set -eox pipefail
137-
./.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} build
125+
- script: |
126+
set -eox pipefail
127+
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} build
138128
env:
139129
CCACHE_DISABLE: 1
140-
130+
displayName: Build ${{ slice.scheme }}
131+
141132
# Skip testing on visionOS via the conditions below
142133

143134
- ${{ if ne(slice.scheme, 'RNTester-visionOS') }}:
144135
- task: ShellScript@2
145-
displayName: 'Setup packager and WebSocket test server'
136+
displayName: Setup packager and WebSocket test server
146137
inputs:
147-
scriptPath: '.ado/scripts/ado-test-setup.sh'
138+
scriptPath: .ado/scripts/ado-test-setup.sh
148139
disableAutoCwd: true
149140
cwd: ''
150141

151-
- bash: |
142+
- script: |
152143
echo Preparing the packager for platform $PLATFORM
153144
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/packages/rn-tester/js/RNTesterApp.${PLATFORM}.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
154145
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/packages/rn-tester/js/RNTesterApp.${PLATFORM}.bundle?platform=${PLATFORM}&dev=true&minify=false" -o /dev/null
155146
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
156147
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
157148
env:
158149
PLATFORM: ${{ slice.packager_platform }}
159-
displayName: 'curl the packager'
150+
displayName: Fetch JS bundles from dev server
160151
161-
- task: CmdLine@2
162-
displayName: Test ${{ slice.scheme }}
163-
inputs:
164-
script: |
165-
set -eox pipefail
166-
./.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} test
152+
- script: |
153+
set -eox pipefail
154+
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} test
167155
env:
168156
CCACHE_DISABLE: 1
157+
displayName: Test ${{ slice.scheme }}
169158
170159
- task: ShellScript@2
171-
displayName: 'Cleanup packager and WebSocket test server'
160+
displayName: Cleanup packager and WebSocket test server
172161
inputs:
173-
scriptPath: '.ado/scripts/ado-test-cleanup.sh'
162+
scriptPath: .ado/scripts/ado-test-cleanup.sh
174163
disableAutoCwd: true
175164
cwd: ''
176165
condition: always()

.ado/jobs/react-native-test-app-integration.yml

Lines changed: 29 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,83 +9,50 @@ jobs:
99
cancelTimeoutInMinutes: 5
1010
steps:
1111
- template: /.ado/templates/apple-tools-setup.yml@self
12-
- bash: |
13-
echo "##vso[task.setvariable variable=package_version]$(cat package.json | jq .version | awk '{ print substr($0, 2, length($0) - 2) }')"
14-
echo "##vso[task.setvariable variable=react_version]$(cat package.json | jq .peerDependencies.react)"
15-
echo "##vso[task.setvariable variable=rncli_version]$(cat package.json | jq '.dependencies."@react-native-community/cli"')"
16-
echo "##vso[task.setvariable variable=rncli_android_version]$(cat package.json | jq '.dependencies."@react-native-community/cli-platform-android"')"
17-
echo "##vso[task.setvariable variable=rncli_ios_version]$(cat package.json | jq '.dependencies."@react-native-community/cli-platform-ios"')"
18-
displayName: 'Determine react-native-macos version'
19-
workingDirectory: packages/react-native
20-
- bash: |
21-
npm pack ./packages/react-native
22-
displayName: 'Pack react-native-macos'
23-
- bash: |
24-
git clone --progress https://github.com/microsoft/react-native-test-app.git
25-
displayName: Checkout react-native-test-app
26-
- bash: |
27-
set -eo pipefail
28-
cat package.json |
29-
jq '.devDependencies["react"] = $(react_version)' |
30-
jq '.devDependencies["react-native"] = "^0.71"' |
31-
jq '.devDependencies["react-native-macos"] = "../react-native-macos-$(package_version).tgz"' |
32-
jq 'del(.devDependencies["@react-native-community/cli"])' |
33-
jq 'del(.devDependencies["@react-native-community/cli-platform-android"])' |
34-
jq 'del(.devDependencies["@react-native-community/cli-platform-ios"])' |
35-
jq 'del(.devDependencies["react-native-windows"])' > .package.json
36-
mv .package.json package.json
37-
cat package.json | jq .devDependencies
38-
displayName: Modify react-native-test-app dependencies
12+
13+
- template: /.ado/templates/verdaccio-publish.yml@self
14+
15+
- script: |
16+
git clone --filter=blob:none --progress https://github.com/microsoft/react-native-test-app.git
17+
displayName: Clone react-native-test-app
18+
19+
- script: |
20+
node .ado/scripts/export-versions.mjs
21+
displayName: Determine react-native version
22+
23+
- script: |
24+
npm run set-react-version $(react_native_version) -- --overrides '{ "react-native-macos": "1000.0.0" }'
25+
displayName: Configure react-native-test-app dependencies
3926
workingDirectory: react-native-test-app
40-
- bash: |
27+
28+
- script: |
4129
set -eo pipefail
42-
cat package.json |
43-
jq '.devDependencies["@react-native-community/cli"] = $(rncli_version)' |
44-
jq '.devDependencies["@react-native-community/cli-platform-android"] = $(rncli_android_version)' |
45-
jq '.devDependencies["@react-native-community/cli-platform-ios"] = $(rncli_ios_version)' |
46-
jq '.devDependencies["react"] = $(react_version)' |
47-
jq '.devDependencies["react-native"] = "^0.71"' |
48-
jq '.devDependencies["react-native-macos"] = "../../react-native-macos-$(package_version).tgz"' |
49-
jq 'del(.devDependencies["react-native-windows"])' > .package.json
50-
mv .package.json package.json
51-
cat package.json | jq .devDependencies
52-
displayName: Modify example app dependencies
53-
workingDirectory: react-native-test-app/example
54-
- template: /.ado/templates/verdaccio-init.yml@self
55-
- bash: |
56-
npx beachball publish --branch origin/$(System.PullRequest.TargetBranch) --no-push --registry http://localhost:4873 --yes --access public
57-
displayName: Publish beachball packages to verdaccio
58-
- bash: |
59-
cat .yarnrc.yml | sed 's_^npmRegistryServer: ".*"$_npmRegistryServer: "http://localhost:4873"_' > .yarnrc.yml.copy
60-
rm .yarnrc.yml
61-
mv .yarnrc.yml.copy .yarnrc.yml
62-
echo -e '\nunsafeHttpWhitelist: ["localhost"]' >> .yarnrc.yml
63-
displayName: Point react-native-test-app registry to verdaccio server
64-
workingDirectory: react-native-test-app
65-
- bash: |
30+
$(Build.Repository.LocalPath)/.ado/scripts/verdaccio.sh configure
6631
yarn --no-immutable
6732
displayName: Install npm dependencies
6833
workingDirectory: react-native-test-app
69-
- bash: |
34+
35+
- script: |
7036
yarn build:macos || yarn build:macos
7137
displayName: Bundle JavaScript
7238
workingDirectory: react-native-test-app/example
73-
- bash: |
39+
40+
- script: |
7441
rm macos/Podfile.lock
7542
pod install --project-directory=macos
7643
displayName: Install Pods
7744
workingDirectory: react-native-test-app/example
78-
- bash: |
79-
set -eo pipefail
80-
../scripts/xcodebuild.sh macos/Example.xcworkspace build | xcbeautify
81-
displayName: Build Intel
45+
46+
- script: |
47+
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build
48+
displayName: Build x86
8249
workingDirectory: react-native-test-app/example
8350
env:
8451
CCACHE_DISABLE: 1
85-
- bash: |
86-
set -eo pipefail
87-
../scripts/xcodebuild.sh macos/Example.xcworkspace clean
88-
../scripts/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64 | xcbeautify
52+
53+
- script: |
54+
../scripts/build/xcodebuild.sh macos/Example.xcworkspace clean
55+
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64
8956
displayName: Build ARM
9057
workingDirectory: react-native-test-app/example
9158
env:

.ado/jobs/test-javascript.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@ jobs:
44
pool:
55
vmImage: $(VmImageApple)
66
steps:
7-
- template: /.ado/templates/apple-tools-setup.yml@self
7+
- template: /.ado/templates/apple-tools-setup.yml@self
88

9-
- task: CmdLine@2
10-
displayName: yarn install
11-
inputs:
12-
script: yarn install --immutable
9+
- script: yarn install
10+
displayName: Install npm dependencies
1311

14-
- task: CmdLine@2
15-
displayName: yarn test-ci [test]
16-
inputs:
17-
script: 'yarn test-ci'
18-
19-
- script: 'yarn flow-check'
20-
displayName: 'yarn flow-check'
12+
- script: yarn test-ci
13+
displayName: Test
2114

22-
- script: 'yarn lint'
23-
displayName: 'yarn lint'
15+
- script: yarn flow-check
16+
displayName: Flow type check
2417

25-
- script: 'yarn format-check'
26-
displayName: 'yarn format-check'
18+
- script: yarn lint
19+
displayName: Lint
20+
21+
- script: yarn format-check
22+
displayName: Format

.ado/jobs/test-react-native-macos-init.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,7 @@ jobs:
1313

1414
- template: /.ado/templates/apple-tools-setup.yml@self
1515

16-
- script: |
17-
set -eox pipefail
18-
yarn install
19-
displayName: Install npm dependencies
20-
21-
- script: |
22-
set -eox pipefail
23-
yarn build
24-
displayName: Build @react-native/community-cli-plugin
25-
26-
- script: |
27-
set -eox pipefail
28-
yarn build
29-
workingDirectory: packages/react-native-macos-init
30-
displayName: Build react-native-macos-init
31-
32-
- template: /.ado/templates/verdaccio-init.yml@self
33-
34-
- script: |
35-
.ado/scripts/verdaccio.sh publish --branch origin/$(System.PullRequest.TargetBranch)
36-
displayName: Publish react-native-macos to Verdaccio
16+
- template: /.ado/templates/verdaccio-publish.yml@self
3717

3818
- script: |
3919
node .ado/scripts/export-versions.mjs

.ado/npmAddUser.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)