Skip to content

Commit

Permalink
try major refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed May 3, 2024
1 parent 936867b commit c7ee5a5
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 322 deletions.
139 changes: 4 additions & 135 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,141 +16,10 @@ pr:
- '*.md'

jobs:
- job: JavaScriptPR
displayName: Javascript PR
pool:
vmImage: $(VmImageApple)
demands: ['xcode', 'sh', 'npm']
steps:
- template: /.ado/templates/apple-job-javascript.yml@self
parameters:
slice_name: $(slice_name)
xcode_version: $(xcode_version)
- template: /.ado/jobs/test-javascript.yml@self

- job: ApplePR
displayName: PR
strategy:
matrix:
'iOS Paper JSC':
packager_platform: 'ios'
xcode_sdk: iphonesimulator
xcode_scheme: 'RNTester'
xcode_destination: 'platform=iOS Simulator,OS=$(ios_version),name=$(ios_simulator)'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '0'
use_hermes: '0'
'macOS Paper JSC':
packager_platform: 'macos'
xcode_sdk: macosx
xcode_scheme: 'RNTester-macOS'
xcode_destination: 'platform=macOS,arch=arm64'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '0'
use_hermes: '0'
'iOS Fabric JSC':
packager_platform: 'ios'
xcode_sdk: iphonesimulator
xcode_scheme: 'RNTester'
xcode_destination: 'platform=iOS Simulator,OS=$(ios_version),name=$(ios_simulator)'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '1'
use_hermes: '0'
'macOS Fabric JSC':
packager_platform: 'macos'
xcode_sdk: macosx
xcode_scheme: 'RNTester-macOS'
xcode_destination: 'platform=macOS,arch=arm64'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '1'
use_hermes: '0'
'visionOS Paper JSC':
packager_platform: 'ios'
xcode_sdk: xros
xcode_scheme: 'RNTester-visionOS'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '0'
use_hermes: '0'
'visionOS Fabric JSC':
packager_platform: 'ios'
xcode_sdk: xros
xcode_scheme: 'RNTester-visionOS'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
new_arch_enabled: '1'
use_hermes: '0'
# Disable Hermes Jobs for now
# 'iOS Paper Hermes':
# packager_platform: 'ios'
# xcode_sdk: iphonesimulator
# xcode_scheme: 'RNTester'
# xcode_destination: 'platform=iOS Simulator,OS=$(ios_version),name=$(ios_simulator)'
# xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
# new_arch_enabled: '0'
# use_hermes: '1'
# 'macOS Paper Hermes':
# packager_platform: 'macos'
# xcode_sdk: macosx
# xcode_scheme: 'RNTester-macOS'
# xcode_destination: 'platform=macOS,arch=arm64'
# xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
# new_arch_enabled: '0'
# use_hermes: '1'
# 'iOS Fabric Hermes':
# packager_platform: 'ios'
# xcode_sdk: iphonesimulator
# xcode_scheme: 'RNTester'
# xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
# new_arch_enabled: '1'
# use_hermes: '1'
# 'macOS Fabric Hermes':
# packager_platform: 'macos'
# xcode_sdk: macosx
# xcode_scheme: 'RNTester-macOS'
# xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/debug_overrides.xcconfig'
# new_arch_enabled: '1'
# use_hermes: '1'
pool:
vmImage: $(VmImageApple)
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
steps:
- template: /.ado/templates/apple-job-react-native.yml@self
parameters:
packager_platform: $(packager_platform)
xcode_sdk: $(xcode_sdk)
xcode_scheme: $(xcode_scheme)
xcode_actions: $(xcode_actions)
slice_name: $(slice_name)
xcode_version: $(xcode_version)
xcode_extraArgs: $(xcode_extraArgs)
- template: /.ado/jobs/test-react-native-macos-init.yml@self

- job: CliInit
displayName: Verify react-native-macos-init
strategy:
matrix:
MacDebug:
configuration: Debug
pool:
vmImage: $(VmImageApple)
demands: ['xcode', 'sh', 'npm']
steps:
- template: /.ado/templates/react-native-macos-init.yml@self
parameters:
configuration: $(configuration)
- template: /.ado/jobs/npm-publish-dry-run.yml@self

- job: NPMPublishDryRun
displayName: NPM Publish Dry Run
pool:
vmImage: $(VmImageApple)
timeoutInMinutes: 60 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
# fetchDepth: 2 # the depth of commits to ask Git to fetch
lfs: false # whether to download Git-LFS files
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch

- template: /.ado/templates/apple-job-publish.yml@self
parameters:
build_type: 'dry-run'
- template: /.ado/jobs/build-test-rntester.yml@self
138 changes: 138 additions & 0 deletions .ado/jobs/build-test-rntester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
parameters:
- name: appleBuildMatrix
type: object
default:
- name: iphoneos_debug
friendly_name: 'iOS Debug'
sdk: iphoneos
configuration: Debug
project_directory: 'packages/react-native-community/ios'
xcconfig: 'SDX_overrides_ios_device.xcconfig'
vmImage: $(VmImageApple)
- name: iphoneos_release
friendly_name: 'iOS Release'
sdk: iphoneos
configuration: Release
project_directory: 'packages/react-native-community/ios'
xcconfig: 'SDX_overrides_ios_device.xcconfig'
vmImage: $(VmImageApple)
- name: iphonesimulator_debug
friendly_name: 'iOS Simulator Debug'
sdk: iphonesimulator
configuration: Debug
project_directory: 'packages/react-native-community/ios'
xcconfig: 'SDX__common.xcconfig'
vmImage: $(VmImageApple)
- name: iphonesimulator_release
friendly_name: 'iOS Simulator Release'
sdk: iphonesimulator
configuration: Release
project_directory: 'packages/react-native-community/ios'
xcconfig: 'SDX__common.xcconfig'
vmImage: $(VmImageApple)
- name: macosx_debug
friendly_name: 'macOS Debug'
sdk: macosx
configuration: Debug
project_directory: 'packages/react-native-community/macos'
xcconfig: 'SDX_overrides_macos.xcconfig'
vmImage: $(VmImageApple)
- name: macosx_release
friendly_name: 'macOS Release'
sdk: macosx
configuration: Release
project_directory: 'packages/react-native-community/macos'
xcconfig: 'SDX_overrides_macos.xcconfig'
vmImage: $(VmImageApple)
- name: visionos_debug
friendly_name: 'visionOS Debug'
sdk: xros
configuration: Debug
project_directory: 'packages/react-native-community/visionos'
xcconfig: 'SDX_overrides_ios_device.xcconfig'
- name: visionos_release
friendly_name: 'visionOS Release'
sdk: xros
configuration: Release
project_directory: 'packages/react-native-community/visionos'
xcconfig: 'SDX_overrides_ios_device.xcconfig'
- name: visionsimulator_debug
friendly_name: 'visionOS Simulator Debug'
sdk: xrsimulator
configuration: Debug
project_directory: 'packages/react-native-community/visionos'
xcconfig: 'SDX__common.xcconfig'
- name: visionsimulator_release
friendly_name: 'visionOS Simulator Release'
sdk: xrsimulator
configuration: Release
project_directory: 'packages/react-native-community/visionos'
xcconfig: 'SDX__common.xcconfig'

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

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

- task: CmdLine@2
displayName: pod install
inputs:
script: |
cd packages/rn-tester
bundle install
bundle exec pod install
env:
RCT_NEW_ARCH_ENABLED: $(new_arch_enabled)
USE_HERMES: $(use_hermes)

- task: ShellScript@2
displayName: 'Setup packager and WebSocket test server'
inputs:
scriptPath: '.ado/ado-test-setup.sh'
disableAutoCwd: true
cwd: ''

- bash: |
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: ${{ parameters.packager_platform }}
displayName: 'curl the packager'
- template: /.ado/templates/apple-xcode-build.yml@self
parameters:
xcode_sdk: ${{ parameters.xcode_sdk }}
xcode_workspacePath: packages/rn-tester/RNTesterPods.xcworkspace
xcode_scheme: ${{ parameters.xcode_scheme }}
xcode_actions: 'build'
xcode_extraArgs: ${{ parameters.xcode_extraArgs }}

- template: /.ado/templates/apple-xcode-build.yml@self
parameters:
xcode_sdk: ${{ parameters.xcode_sdk }}
xcode_workspacePath: packages/rn-tester/RNTesterPods.xcworkspace
xcode_scheme: ${{ parameters.xcode_scheme }}
xcode_actions: 'test'
xcode_extraArgs: ${{ parameters.xcode_extraArgs }}

- task: ShellScript@2
displayName: 'Cleanup packager and WebSocket test server'
inputs:
scriptPath: '.ado/ado-test-cleanup.sh'
disableAutoCwd: true
cwd: ''
condition: always()
18 changes: 18 additions & 0 deletions .ado/jobs/npm-publish-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
jobs:
- job: NPMPublishDryRun
displayName: NPM Publish Dry Run
pool:
vmImage: $(VmImageApple)
timeoutInMinutes: 60 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
# fetchDepth: 2 # the depth of commits to ask Git to fetch
lfs: false # whether to download Git-LFS files
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch

- template: /.ado/templates/apple-job-publish.yml@self
parameters:
build_type: 'dry-run'
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
cancelTimeoutInMinutes: 5
steps:
- template: /.ado/templates/apple-tools-setup.yml@self
parameters:
slice_name: $(slice_name)
xcode_version: $(xcode_version)
- 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)"
Expand Down
26 changes: 26 additions & 0 deletions .ado/jobs/test-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
jobs:
- job: JavaScriptPR
displayName: Javascript PR
pool:
vmImage: $(VmImageApple)
steps:
- template: /.ado/templates/apple-tools-setup.yml@self

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

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

- script: 'yarn flow-check'
displayName: 'yarn flow-check'

- script: 'yarn lint'
displayName: 'yarn lint'

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

0 comments on commit c7ee5a5

Please sign in to comment.