Skip to content

Commit b4f6262

Browse files
cortinicofacebook-github-bot
authored andcommitted
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: #34355 Test Plan: Will wait for a green CI Reviewed By: cipolleschi Differential Revision: D38499773 Pulled By: cortinico fbshipit-source-id: 5a24c21d111fb4ae0f4600d86b786021f6ad2abe
1 parent 7a911e0 commit b4f6262

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

.circleci/config.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,17 @@ jobs:
677677
# -------------------------
678678
test_android_template:
679679
executor: reactnativeandroid
680+
parameters:
681+
flavor:
682+
type: string
683+
default: "Debug"
684+
newarchitecture:
685+
type: boolean
686+
default: false
687+
environment:
688+
- PROJECT_NAME: "AndroidTemplateProject"
680689
steps:
681-
- checkout
690+
- checkout_code_with_cache
682691
- run_yarn
683692
- attach_workspace:
684693
at: .
@@ -687,15 +696,14 @@ jobs:
687696
name: Create Android template project
688697
command: |
689698
REPO_ROOT=$(pwd)
690-
PACKAGE=$(cat build/react-native-package-version)
691-
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
692-
cd template
693-
npm add $PATH_TO_PACKAGE
694-
npm install
699+
node ./scripts/set-rn-template-version.js "file:$REPO_ROOT/build/$(cat build/react-native-package-version)"
700+
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose --skip-install
701+
cd /tmp/$PROJECT_NAME
702+
yarn
695703
696704
- run:
697-
name: Build the template application
698-
command: cd template/android/ && ./gradlew assembleDebug
705+
name: Build the template application for << parameters.flavor >> with New Architecture set << parameters.newarchitecture >>
706+
command: cd /tmp/$PROJECT_NAME/android/ && ./gradlew assemble<< parameters.flavor >> -PnewArchEnabled=<< parameters.newarchitecture >>
699707

700708
# -------------------------
701709
# JOBS: Test iOS Template
@@ -726,14 +734,12 @@ jobs:
726734
PACKAGE=$(cat build/react-native-package-version)
727735
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
728736
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
729-
mkdir -p ~/tmp
730-
cd ~/tmp
731-
node "$REPO_ROOT/cli.js" init "$PROJECT_NAME" --template "$REPO_ROOT" --verbose
737+
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose
732738
- run:
733739
name: Build template project
734740
command: |
735741
xcodebuild build \
736-
-workspace ~/tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
742+
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
737743
-scheme $PROJECT_NAME \
738744
-sdk iphonesimulator
739745
@@ -1327,6 +1333,10 @@ workflows:
13271333
- test_android_template:
13281334
requires:
13291335
- build_npm_package
1336+
matrix:
1337+
parameters:
1338+
newarchitecture: [true, false]
1339+
flavor: ["Debug", "Release"]
13301340
- test_ios_template:
13311341
requires:
13321342
- build_npm_package

0 commit comments

Comments
 (0)