From b4f6262bccc7ab96c23f53982701fb0e09752d97 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 8 Aug 2022 04:44:48 -0700 Subject: [PATCH] Setup a build matrix for test_android_template (#34355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .circleci/config.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fae3a50f24..60b8378576 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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