Skip to content

Commit

Permalink
ci: fix RNTA integration pipeline (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 authored Oct 30, 2024
1 parent fd1bc5c commit 9945e86
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ stages:
dependsOn: []
jobs:
- template: /.ado/jobs/test-react-native-macos-init.yml@self
#- template: /.ado/jobs/react-native-test-app-integration.yml@self
- template: /.ado/jobs/react-native-test-app-integration.yml@self
95 changes: 42 additions & 53 deletions .ado/jobs/build-test-rntester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
- name: appleBuildMatrix
type: object
default:
- name: macos_oldarch_jsc
- name: macos_oldarch_jsc
friendly_name: 'macOS, Old Arch, JSC'
sdk: macosx
scheme: RNTester-macOS
Expand Down Expand Up @@ -30,7 +30,7 @@ parameters:
# packager_platform: 'macos'
# new_arch_enabled: '1'
# use_hermes: '1'
- name: ios_oldarch_jsc
- name: ios_oldarch_jsc
friendly_name: 'iOS, Old Arch, JSC'
sdk: iphonesimulator
scheme: RNTester
Expand Down Expand Up @@ -58,7 +58,7 @@ parameters:
# packager_platform: 'ios'
# new_arch_enabled: '1'
# use_hermes: '1'
- name: xros_oldarch_jsc
- name: xros_oldarch_jsc
friendly_name: 'xrOS, Old Arch, JSC'
sdk: xrsimulator
scheme: RNTester-visionOS
Expand Down Expand Up @@ -89,88 +89,77 @@ parameters:

jobs:
- ${{ each slice in parameters.appleBuildMatrix }}:
- job: ${{ slice.name }}
displayName: ${{ slice.friendly_name }}
pool:
vmImage: $(vmImageApple)
timeoutInMinutes: 90
cancelTimeoutInMinutes: 5
steps:
- job: ${{ slice.name }}
displayName: ${{ slice.friendly_name }}
pool:
vmImage: $(vmImageApple)
timeoutInMinutes: 90
cancelTimeoutInMinutes: 5
steps:
- template: /.ado/templates/apple-tools-setup.yml@self

- ${{ if in(slice.sdk, 'xros', 'xrsimulator') }}:
- task: CmdLine@2
displayName: Download visionOS SDDK
inputs:
script: |
set -eox pipefail
# https://github.com/actions/runner-images/issues/10559
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- task: CmdLine@2
displayName: yarn install
inputs:
script: |
- script: |
set -eox pipefail
yarn install --immutable
# https://github.com/actions/runner-images/issues/10559
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
displayName: Download visionOS SDK
- task: CmdLine@2
displayName: pod install
inputs:
script: |
set -eox pipefail
cd packages/rn-tester
bundle install
bundle exec pod install --verbose
- script: |
yarn install
displayName: Install npm dependencies
- script: |
set -eox pipefail
bundle install
bundle exec pod install --verbose
env:
RCT_NEW_ARCH_ENABLED: ${{ slice.new_arch_enabled }}
USE_HERMES: ${{ slice.use_hermes }}
workingDirectory: packages/rn-tester
displayName: Install Pods
- task: CmdLine@2
displayName: Build ${{ slice.scheme }}
inputs:
script: |
set -eox pipefail
./.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} build
- script: |
set -eox pipefail
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} build
env:
CCACHE_DISABLE: 1

displayName: Build ${{ slice.scheme }}
# Skip testing on visionOS via the conditions below

- ${{ if ne(slice.scheme, 'RNTester-visionOS') }}:
- task: ShellScript@2
displayName: 'Setup packager and WebSocket test server'
displayName: Setup packager and WebSocket test server
inputs:
scriptPath: '.ado/scripts/ado-test-setup.sh'
scriptPath: .ado/scripts/ado-test-setup.sh
disableAutoCwd: true
cwd: ''

- bash: |
- script: |
echo Preparing the packager for platform $PLATFORM
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
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
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
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
env:
PLATFORM: ${{ slice.packager_platform }}
displayName: 'curl the packager'
displayName: Fetch JS bundles from dev server
- task: CmdLine@2
displayName: Test ${{ slice.scheme }}
inputs:
script: |
set -eox pipefail
./.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} test
- script: |
set -eox pipefail
.ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ slice.sdk }} ${{ slice.scheme }} test
env:
CCACHE_DISABLE: 1
displayName: Test ${{ slice.scheme }}
- task: ShellScript@2
displayName: 'Cleanup packager and WebSocket test server'
displayName: Cleanup packager and WebSocket test server
inputs:
scriptPath: '.ado/scripts/ado-test-cleanup.sh'
scriptPath: .ado/scripts/ado-test-cleanup.sh
disableAutoCwd: true
cwd: ''
condition: always()
91 changes: 29 additions & 62 deletions .ado/jobs/react-native-test-app-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,50 @@ jobs:
cancelTimeoutInMinutes: 5
steps:
- template: /.ado/templates/apple-tools-setup.yml@self
- bash: |
echo "##vso[task.setvariable variable=package_version]$(cat package.json | jq .version | awk '{ print substr($0, 2, length($0) - 2) }')"
echo "##vso[task.setvariable variable=react_version]$(cat package.json | jq .peerDependencies.react)"
echo "##vso[task.setvariable variable=rncli_version]$(cat package.json | jq '.dependencies."@react-native-community/cli"')"
echo "##vso[task.setvariable variable=rncli_android_version]$(cat package.json | jq '.dependencies."@react-native-community/cli-platform-android"')"
echo "##vso[task.setvariable variable=rncli_ios_version]$(cat package.json | jq '.dependencies."@react-native-community/cli-platform-ios"')"
displayName: 'Determine react-native-macos version'
workingDirectory: packages/react-native
- bash: |
npm pack ./packages/react-native
displayName: 'Pack react-native-macos'
- bash: |
git clone --progress https://github.com/microsoft/react-native-test-app.git
displayName: Checkout react-native-test-app
- bash: |
set -eo pipefail
cat package.json |
jq '.devDependencies["react"] = $(react_version)' |
jq '.devDependencies["react-native"] = "^0.71"' |
jq '.devDependencies["react-native-macos"] = "../react-native-macos-$(package_version).tgz"' |
jq 'del(.devDependencies["@react-native-community/cli"])' |
jq 'del(.devDependencies["@react-native-community/cli-platform-android"])' |
jq 'del(.devDependencies["@react-native-community/cli-platform-ios"])' |
jq 'del(.devDependencies["react-native-windows"])' > .package.json
mv .package.json package.json
cat package.json | jq .devDependencies
displayName: Modify react-native-test-app dependencies

- template: /.ado/templates/verdaccio-publish.yml@self

- script: |
git clone --filter=blob:none --progress https://github.com/microsoft/react-native-test-app.git
displayName: Clone react-native-test-app
- script: |
node .ado/scripts/export-versions.mjs
displayName: Determine react-native version
- script: |
npm run set-react-version $(react_native_version) -- --overrides '{ "react-native-macos": "1000.0.0" }'
displayName: Configure react-native-test-app dependencies
workingDirectory: react-native-test-app
- bash: |
- script: |
set -eo pipefail
cat package.json |
jq '.devDependencies["@react-native-community/cli"] = $(rncli_version)' |
jq '.devDependencies["@react-native-community/cli-platform-android"] = $(rncli_android_version)' |
jq '.devDependencies["@react-native-community/cli-platform-ios"] = $(rncli_ios_version)' |
jq '.devDependencies["react"] = $(react_version)' |
jq '.devDependencies["react-native"] = "^0.71"' |
jq '.devDependencies["react-native-macos"] = "../../react-native-macos-$(package_version).tgz"' |
jq 'del(.devDependencies["react-native-windows"])' > .package.json
mv .package.json package.json
cat package.json | jq .devDependencies
displayName: Modify example app dependencies
workingDirectory: react-native-test-app/example
- template: /.ado/templates/verdaccio-init.yml@self
- bash: |
npx beachball publish --branch origin/$(System.PullRequest.TargetBranch) --no-push --registry http://localhost:4873 --yes --access public
displayName: Publish beachball packages to verdaccio
- bash: |
cat .yarnrc.yml | sed 's_^npmRegistryServer: ".*"$_npmRegistryServer: "http://localhost:4873"_' > .yarnrc.yml.copy
rm .yarnrc.yml
mv .yarnrc.yml.copy .yarnrc.yml
echo -e '\nunsafeHttpWhitelist: ["localhost"]' >> .yarnrc.yml
displayName: Point react-native-test-app registry to verdaccio server
workingDirectory: react-native-test-app
- bash: |
$(Build.Repository.LocalPath)/.ado/scripts/verdaccio.sh configure
yarn --no-immutable
displayName: Install npm dependencies
workingDirectory: react-native-test-app
- bash: |
- script: |
yarn build:macos || yarn build:macos
displayName: Bundle JavaScript
workingDirectory: react-native-test-app/example
- bash: |
- script: |
rm macos/Podfile.lock
pod install --project-directory=macos
displayName: Install Pods
workingDirectory: react-native-test-app/example
- bash: |
set -eo pipefail
../scripts/xcodebuild.sh macos/Example.xcworkspace build | xcbeautify
displayName: Build Intel
- script: |
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build
displayName: Build x86
workingDirectory: react-native-test-app/example
env:
CCACHE_DISABLE: 1
- bash: |
set -eo pipefail
../scripts/xcodebuild.sh macos/Example.xcworkspace clean
../scripts/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64 | xcbeautify
- script: |
../scripts/build/xcodebuild.sh macos/Example.xcworkspace clean
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64
displayName: Build ARM
workingDirectory: react-native-test-app/example
env:
Expand Down
28 changes: 12 additions & 16 deletions .ado/jobs/test-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@ jobs:
pool:
vmImage: $(VmImageApple)
steps:
- template: /.ado/templates/apple-tools-setup.yml@self
- template: /.ado/templates/apple-tools-setup.yml@self

- task: CmdLine@2
displayName: yarn install
inputs:
script: yarn install --immutable
- script: yarn install
displayName: Install npm dependencies

- task: CmdLine@2
displayName: yarn test-ci [test]
inputs:
script: 'yarn test-ci'

- script: 'yarn flow-check'
displayName: 'yarn flow-check'
- script: yarn test-ci
displayName: Test

- script: 'yarn lint'
displayName: 'yarn lint'
- script: yarn flow-check
displayName: Flow type check

- script: 'yarn format-check'
displayName: 'yarn format-check'
- script: yarn lint
displayName: Lint

- script: yarn format-check
displayName: Format
22 changes: 1 addition & 21 deletions .ado/jobs/test-react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,7 @@ jobs:

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

- script: |
set -eox pipefail
yarn install
displayName: Install npm dependencies
- script: |
set -eox pipefail
yarn build
displayName: Build @react-native/community-cli-plugin
- script: |
set -eox pipefail
yarn build
workingDirectory: packages/react-native-macos-init
displayName: Build react-native-macos-init
- template: /.ado/templates/verdaccio-init.yml@self

- script: |
.ado/scripts/verdaccio.sh publish --branch origin/$(System.PullRequest.TargetBranch)
displayName: Publish react-native-macos to Verdaccio
- template: /.ado/templates/verdaccio-publish.yml@self

- script: |
node .ado/scripts/export-versions.mjs
Expand Down
40 changes: 0 additions & 40 deletions .ado/npmAddUser.js

This file was deleted.

Loading

0 comments on commit 9945e86

Please sign in to comment.