From f08dda3438f4fb5fd0099142f5a5768650a1fe6b Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Tue, 23 Apr 2024 08:17:11 +0100 Subject: [PATCH] test RN 0.66 build --- .../basic/react-native-android-pipeline.yml | 46 +++++++++++++++++++ .../basic/react-native-ios-pipeline.yml | 45 ++++++++++++++++++ scripts/generate-react-native-fixture.js | 10 ++-- 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/.buildkite/basic/react-native-android-pipeline.yml b/.buildkite/basic/react-native-android-pipeline.yml index a36835d90..8e50a398e 100644 --- a/.buildkite/basic/react-native-android-pipeline.yml +++ b/.buildkite/basic/react-native-android-pipeline.yml @@ -46,6 +46,52 @@ steps: automatic: - exit_status: "*" limit: 1 + + - label: ':android: Build RN {{matrix}} test fixture APK (Old Arch)' + key: "build-react-native-android-fixture-old-arch-old-versions" + timeout_in_minutes: 30 + agents: + queue: macos-12-arm + env: + JAVA_VERSION: "11" + NODE_VERSION: "16" + RN_VERSION: "{{matrix}}" + BUILD_ANDROID: "true" + artifact_paths: + - "test/react-native/features/fixtures/generated/old-arch/**/reactnative.apk" + commands: + - "bundle install" + - "node scripts/generate-react-native-fixture.js" + matrix: + - "0.66" + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ':android: Build RN {{matrix}} test fixture APK (New Arch)' + key: "build-react-native-android-fixture-new-arch-old-versions" + timeout_in_minutes: 30 + agents: + queue: macos-12-arm + env: + JAVA_VERSION: "11" + NODE_VERSION: "16" + RN_VERSION: "{{matrix}}" + RCT_NEW_ARCH_ENABLED: "true" + BUILD_ANDROID: "true" + artifact_paths: + - "test/react-native/features/fixtures/generated/new-arch/**/reactnative.apk" + commands: + - "bundle install" + - "node scripts/generate-react-native-fixture.js" + matrix: + - "0.66" + retry: + automatic: + - exit_status: "*" + limit: 1 + # # # # Android builder # # diff --git a/.buildkite/basic/react-native-ios-pipeline.yml b/.buildkite/basic/react-native-ios-pipeline.yml index c8928ca06..5b9e109ba 100644 --- a/.buildkite/basic/react-native-ios-pipeline.yml +++ b/.buildkite/basic/react-native-ios-pipeline.yml @@ -51,6 +51,51 @@ steps: - exit_status: "*" limit: 1 + - label: ':mac: Build RN {{matrix}} test fixture ipa (Old Arch)' + key: "build-react-native-ios-fixture-old-arch-old-versions" + timeout_in_minutes: 30 + agents: + queue: "macos-12-arm" + env: + NODE_VERSION: "16" + RN_VERSION: "{{matrix}}" + BUILD_IOS: "true" + DEVELOPER_DIR: "/Applications/Xcode14.app" + artifact_paths: + - "test/react-native/features/fixtures/generated/old-arch/**/output/reactnative.ipa" + commands: + - "bundle install" + - "node scripts/generate-react-native-fixture.js" + matrix: + - "0.66" + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ':mac: Build RN {{matrix}} test fixture ipa (New Arch)' + key: "build-react-native-ios-fixture-new-arch-old-versions" + timeout_in_minutes: 30 + agents: + queue: "macos-12-arm" + env: + NODE_VERSION: "16" + RN_VERSION: "{{matrix}}" + RCT_NEW_ARCH_ENABLED: "1" + BUILD_IOS: "true" + DEVELOPER_DIR: "/Applications/Xcode14.app" + artifact_paths: + - "test/react-native/features/fixtures/generated/new-arch/**/output/reactnative.ipa" + commands: + - "bundle install" + - "node scripts/generate-react-native-fixture.js" + matrix: + - "0.66" + retry: + automatic: + - exit_status: "*" + limit: 1 + # - label: ":ios: Build RN 0.72 (Old Arch) ipa" # key: "rn-0-72-old-arch-ipa" # timeout_in_minutes: 60 diff --git a/scripts/generate-react-native-fixture.js b/scripts/generate-react-native-fixture.js index 006b98cfe..46130d734 100644 --- a/scripts/generate-react-native-fixture.js +++ b/scripts/generate-react-native-fixture.js @@ -13,9 +13,6 @@ if (!process.env.REGISTRY_URL) { process.exit(1) } -console.log('generate script registry URL:', process.env.REGISTRY_URL) -console.log('generate script publish URL:', process.env.PUBLISH_URL) - const notifierVersion = process.env.NOTIFIER_VERSION || common.determineVersion() const rnVersion = process.env.RN_VERSION @@ -83,8 +80,11 @@ if (!process.env.SKIP_GENERATE_FIXTURE) { const RNInitArgs = ['react-native@latest', 'init', 'reactnative', '--package-name', 'com.bugsnag.fixtures.reactnative', '--directory', fixtureDir, '--version', rnVersion, '--npm', '--skip-install'] execFileSync('npx', RNInitArgs, { stdio: 'inherit' }) - // replace the App.tsx file with our own App.js file - fs.unlinkSync(resolve(fixtureDir, 'App.tsx')) + // replace the App.js/App.tsx file with our own App.js file + fs.readdirSync(resolve(fixtureDir)) + .filter((file) => /App\.[tj]sx?$/.test(file)) + .map((file) => fs.unlinkSync(resolve(fixtureDir, file))) + fs.copyFileSync( resolve(replacementFilesDir, 'App.js'), resolve(fixtureDir, 'App.js')