Setup a build matrix for test_android_template (#34355)

Summary:
I'm extending `test_android_template` to use a CI Matrix. This will allow us to make sure that we test a new app template against Debug/Release and against New/Old Arch.

This will make sure we catch a lot of bugs early on 👍

## Changelog

[Internal] - Setup a build matrix for test_android_template

Pull Request resolved: https://github.com/facebook/react-native/pull/34355

Test Plan: Will wait for a green CI

Reviewed By: cipolleschi

Differential Revision: D38499773

Pulled By: cortinico

fbshipit-source-id: 5a24c21d111fb4ae0f4600d86b786021f6ad2abe
This commit is contained in:
Nicola Corti 2022-08-08 04:44:48 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 7a911e0730
Коммит b4f6262bcc
1 изменённых файлов: 22 добавлений и 12 удалений

Просмотреть файл

@ -677,8 +677,17 @@ jobs:
# -------------------------
test_android_template:
executor: reactnativeandroid
parameters:
flavor:
type: string
default: "Debug"
newarchitecture:
type: boolean
default: false
environment:
- PROJECT_NAME: "AndroidTemplateProject"
steps:
- checkout
- checkout_code_with_cache
- run_yarn
- attach_workspace:
at: .
@ -687,15 +696,14 @@ jobs:
name: Create Android template project
command: |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
cd template
npm add $PATH_TO_PACKAGE
npm install
node ./scripts/set-rn-template-version.js "file:$REPO_ROOT/build/$(cat build/react-native-package-version)"
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose --skip-install
cd /tmp/$PROJECT_NAME
yarn
- run:
name: Build the template application
command: cd template/android/ && ./gradlew assembleDebug
name: Build the template application for << parameters.flavor >> with New Architecture set << parameters.newarchitecture >>
command: cd /tmp/$PROJECT_NAME/android/ && ./gradlew assemble<< parameters.flavor >> -PnewArchEnabled=<< parameters.newarchitecture >>
# -------------------------
# JOBS: Test iOS Template
@ -726,14 +734,12 @@ jobs:
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
mkdir -p ~/tmp
cd ~/tmp
node "$REPO_ROOT/cli.js" init "$PROJECT_NAME" --template "$REPO_ROOT" --verbose
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose
- run:
name: Build template project
command: |
xcodebuild build \
-workspace ~/tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
-scheme $PROJECT_NAME \
-sdk iphonesimulator
@ -1327,6 +1333,10 @@ workflows:
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
newarchitecture: [true, false]
flavor: ["Debug", "Release"]
- test_ios_template:
requires:
- build_npm_package