From ceee898c3e2c264de502eedf02d434118687a98b Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 15:31:56 -0700 Subject: [PATCH 01/11] MORE SHARDS MEANS MORE CI --- .cirrus.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d27ce6865e55..915f9f80a6a6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -63,8 +63,10 @@ task: - name: build-apks+java-test+firebase-test-lab env: matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" matrix: CHANNEL: "master" CHANNEL: "stable" From 70529c6308292b42134a1f988b2b4ecea34493db Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 16:46:52 -0700 Subject: [PATCH 02/11] even more --- .cirrus.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 915f9f80a6a6..8fc08a6bc3e1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -63,10 +63,12 @@ task: - name: build-apks+java-test+firebase-test-lab env: matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 4 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 5 --shardCount 6" matrix: CHANNEL: "master" CHANNEL: "stable" From 62795bb81144d02126ea5b66eb8fd2dbfd671076 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 17:14:08 -0700 Subject: [PATCH 03/11] CI From 9a0240c4f5c5bf2939ccb9b7a9052a8088199496 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 19:38:14 -0700 Subject: [PATCH 04/11] debug --- script/incremental_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 3b0b97f0dbe6..bcb8ee252b73 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" readonly REPO_DIR="$(dirname "$SCRIPT_DIR")" From ca7e3eae59a395bf41b3a061a385422943724b78 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 19:39:00 -0700 Subject: [PATCH 05/11] debug --- .cirrus.yml | 308 ++++++++++++++++++++++++++-------------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8fc08a6bc3e1..5bf7803b223a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,59 +16,59 @@ task: - git fetch origin master activate_script: pub global activate flutter_plugin_tools matrix: - - name: publishable - script: - - flutter channel master - - ./script/check_publish.sh - - name: format - install_script: - - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" - - sudo apt-get update - - sudo apt-get install -y --allow-unauthenticated clang-format-7 - format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7 - - name: test - env: - matrix: - CHANNEL: "master" - CHANNEL: "stable" - test_script: - # TODO(jackson): Allow web plugins once supported on stable - # https://github.com/flutter/flutter/issues/42864 - - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - - flutter channel $CHANNEL - - ./script/incremental_build.sh test - - name: analyze - script: ./script/incremental_build.sh analyze - - name: build_all_plugins_apk - script: - # TODO(jackson): Allow web plugins once supported on stable - # https://github.com/flutter/flutter/issues/42864 - - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - - flutter channel $CHANNEL - - ./script/build_all_plugins_app.sh apk - - name: e2e_web_smoke_test - # Tests e2e example test in web. - only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''" - install_script: - - flutter config --enable-web - - git clone https://github.com/flutter/web_installers.git - - cd web_installers/packages/web_drivers/ - - pub get - - dart lib/web_driver_installer.dart chromedriver --install-only - - ./chromedriver/chromedriver --port=4444 & - test_script: - - cd $E2E_PATH/example/ - - flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome + # - name: publishable + # script: + # - flutter channel master + # - ./script/check_publish.sh + # - name: format + # install_script: + # - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + # - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" + # - sudo apt-get update + # - sudo apt-get install -y --allow-unauthenticated clang-format-7 + # format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7 + # - name: test + # env: + # matrix: + # CHANNEL: "master" + # CHANNEL: "stable" + # test_script: + # # TODO(jackson): Allow web plugins once supported on stable + # # https://github.com/flutter/flutter/issues/42864 + # - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + # - flutter channel $CHANNEL + # - ./script/incremental_build.sh test + # - name: analyze + # script: ./script/incremental_build.sh analyze + # - name: build_all_plugins_apk + # script: + # # TODO(jackson): Allow web plugins once supported on stable + # # https://github.com/flutter/flutter/issues/42864 + # - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + # - flutter channel $CHANNEL + # - ./script/build_all_plugins_app.sh apk + # - name: e2e_web_smoke_test + # # Tests e2e example test in web. + # only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''" + # install_script: + # - flutter config --enable-web + # - git clone https://github.com/flutter/web_installers.git + # - cd web_installers/packages/web_drivers/ + # - pub get + # - dart lib/web_driver_installer.dart chromedriver --install-only + # - ./chromedriver/chromedriver --port=4444 & + # test_script: + # - cd $E2E_PATH/example/ + # - flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome - name: build-apks+java-test+firebase-test-lab env: matrix: PLUGIN_SHARDING: "--shardIndex 0 --shardCount 6" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 6" - PLUGIN_SHARDING: "--shardIndex 2 --shardCount 6" - PLUGIN_SHARDING: "--shardIndex 3 --shardCount 6" - PLUGIN_SHARDING: "--shardIndex 4 --shardCount 6" - PLUGIN_SHARDING: "--shardIndex 5 --shardCount 6" + # PLUGIN_SHARDING: "--shardIndex 1 --shardCount 6" + # PLUGIN_SHARDING: "--shardIndex 2 --shardCount 6" + # PLUGIN_SHARDING: "--shardIndex 3 --shardCount 6" + # PLUGIN_SHARDING: "--shardIndex 4 --shardCount 6" + # PLUGIN_SHARDING: "--shardIndex 5 --shardCount 6" matrix: CHANNEL: "master" CHANNEL: "stable" @@ -100,109 +100,109 @@ task: - export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt` - export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt` -task: - # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins - only_if: $CIRRUS_TAG == '' - use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' - container: - dockerfile: .ci/Dockerfile-LinuxDesktop - cpu: 8 - memory: 16G - env: - E2E_PATH: "./packages/e2e" - upgrade_script: - - flutter channel stable - - flutter upgrade - - flutter channel master - - flutter upgrade - - git fetch origin master - activate_script: pub global activate flutter_plugin_tools - matrix: - - name: build-linux+drive-examples - install_script: - - flutter config --enable-linux-desktop - build_script: - # TODO(stuartmorgan): Include stable once Linux is supported on stable. - - flutter channel master - - ./script/incremental_build.sh build-examples --linux - - xvfb-run ./script/incremental_build.sh drive-examples --linux +# task: +# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins +# only_if: $CIRRUS_TAG == '' +# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' +# container: +# dockerfile: .ci/Dockerfile-LinuxDesktop +# cpu: 8 +# memory: 16G +# env: +# E2E_PATH: "./packages/e2e" +# upgrade_script: +# - flutter channel stable +# - flutter upgrade +# - flutter channel master +# - flutter upgrade +# - git fetch origin master +# activate_script: pub global activate flutter_plugin_tools +# matrix: +# - name: build-linux+drive-examples +# install_script: +# - flutter config --enable-linux-desktop +# build_script: +# # TODO(stuartmorgan): Include stable once Linux is supported on stable. +# - flutter channel master +# - ./script/incremental_build.sh build-examples --linux +# - xvfb-run ./script/incremental_build.sh drive-examples --linux -task: - # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins - only_if: $CIRRUS_TAG == '' - use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' - osx_instance: - image: catalina-xcode-11.3.1-flutter - upgrade_script: - - flutter channel stable - - flutter upgrade - - flutter channel master - - flutter upgrade - - git fetch origin master - activate_script: pub global activate flutter_plugin_tools - create_simulator_script: - - xcrun simctl list - - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot - matrix: - - name: build_all_plugins_ipa - script: - # TODO(jackson): Allow web plugins once supported on stable - # https://github.com/flutter/flutter/issues/42864 - - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - - flutter channel $CHANNEL - - ./script/build_all_plugins_app.sh ios --no-codesign - - name: lint_darwin_plugins - env: - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" - script: - # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. - - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm - # Skip the dummy podspecs used to placate the tool. - - find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm - - ./script/incremental_build.sh podspecs - - name: build-ipas+drive-examples - env: - PATH: $PATH:/usr/local/bin - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] - build_script: - # TODO(jackson): Allow web plugins once supported on stable - # https://github.com/flutter/flutter/issues/42864 - - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - - flutter channel $CHANNEL - - ./script/incremental_build.sh build-examples --ipa - - ./script/incremental_build.sh drive-examples -task: - # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins - only_if: $CIRRUS_TAG == '' - use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' - osx_instance: - image: catalina-xcode-11.3.1-flutter - setup_script: - - flutter config --enable-macos-desktop - upgrade_script: - - flutter channel master - - flutter upgrade - - git fetch origin master - activate_script: pub global activate flutter_plugin_tools - matrix: - - name: build_all_plugins_app - script: - - flutter channel master - - ./script/build_all_plugins_app.sh macos - - name: build-apps+drive-examples - env: - PATH: $PATH:/usr/local/bin - build_script: - - flutter channel master - - ./script/incremental_build.sh build-examples --macos --no-ipa - - ./script/incremental_build.sh drive-examples --macos +# task: +# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins +# only_if: $CIRRUS_TAG == '' +# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' +# osx_instance: +# image: catalina-xcode-11.3.1-flutter +# upgrade_script: +# - flutter channel stable +# - flutter upgrade +# - flutter channel master +# - flutter upgrade +# - git fetch origin master +# activate_script: pub global activate flutter_plugin_tools +# create_simulator_script: +# - xcrun simctl list +# - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot +# matrix: +# - name: build_all_plugins_ipa +# script: +# # TODO(jackson): Allow web plugins once supported on stable +# # https://github.com/flutter/flutter/issues/42864 +# - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi +# - flutter channel $CHANNEL +# - ./script/build_all_plugins_app.sh ios --no-codesign +# - name: lint_darwin_plugins +# env: +# matrix: +# PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" +# PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" +# script: +# # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. +# - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm +# # Skip the dummy podspecs used to placate the tool. +# - find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm +# - ./script/incremental_build.sh podspecs +# - name: build-ipas+drive-examples +# env: +# PATH: $PATH:/usr/local/bin +# matrix: +# PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" +# PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" +# PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" +# PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" +# matrix: +# CHANNEL: "master" +# CHANNEL: "stable" +# SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] +# build_script: +# # TODO(jackson): Allow web plugins once supported on stable +# # https://github.com/flutter/flutter/issues/42864 +# - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi +# - flutter channel $CHANNEL +# - ./script/incremental_build.sh build-examples --ipa +# - ./script/incremental_build.sh drive-examples +# task: +# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins +# only_if: $CIRRUS_TAG == '' +# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' +# osx_instance: +# image: catalina-xcode-11.3.1-flutter +# setup_script: +# - flutter config --enable-macos-desktop +# upgrade_script: +# - flutter channel master +# - flutter upgrade +# - git fetch origin master +# activate_script: pub global activate flutter_plugin_tools +# matrix: +# - name: build_all_plugins_app +# script: +# - flutter channel master +# - ./script/build_all_plugins_app.sh macos +# - name: build-apps+drive-examples +# env: +# PATH: $PATH:/usr/local/bin +# build_script: +# - flutter channel master +# - ./script/incremental_build.sh build-examples --macos --no-ipa +# - ./script/incremental_build.sh drive-examples --macos From c0178e7ffd4a066897a4ba43f7c6263590162f6f Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 20:49:00 -0700 Subject: [PATCH 06/11] .. --- script/incremental_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index bcb8ee252b73..3f61afb67bbb 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,6 +29,8 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" +PLUGIN_SHARDING="${PLUGIN_SHARDING%\'}" +PLUGIN_SHARDING="${PLUGIN_SHARDING#\'}" if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) From 02a2cab4329d3b090e654236fcee58e91a58541f Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 20:55:42 -0700 Subject: [PATCH 07/11] .. --- script/incremental_build.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 3f61afb67bbb..258f50d68050 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,11 +29,9 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" -PLUGIN_SHARDING="${PLUGIN_SHARDING%\'}" -PLUGIN_SHARDING="${PLUGIN_SHARDING#\'}" if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else # Sets CHANGED_PACKAGES check_changed_packages @@ -41,10 +39,10 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) echo "Running version check for changed packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi From a1240afa597b399fb37f31fb1da2e143d48e088c Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 22:31:26 -0700 Subject: [PATCH 08/11] .. --- script/incremental_build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 258f50d68050..15bd9f57a4b8 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,9 +29,13 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" +echo $PLUGIN_SHARDING +echo $PLUGIN_SHARDING | tr -d "'" +exit 0 + if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) else # Sets CHANGED_PACKAGES check_changed_packages @@ -39,10 +43,10 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING) echo "Running version check for changed packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi From 589ec8363f9aaa5a857ef63074552445fa71721c Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 22:49:46 -0700 Subject: [PATCH 09/11] .. --- script/incremental_build.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 15bd9f57a4b8..3b0964f01866 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,13 +29,10 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" -echo $PLUGIN_SHARDING -echo $PLUGIN_SHARDING | tr -d "'" -exit 0 if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" "$PLUGIN_SHARDING") else # Sets CHANGED_PACKAGES check_changed_packages @@ -43,10 +40,10 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" "$PLUGIN_SHARDING") else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" "$PLUGIN_SHARDING") echo "Running version check for changed packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi From 7600baa76fa8ef5484ffb7b4beff2644f0ace5ae Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 23:00:37 -0700 Subject: [PATCH 10/11] .. --- script/incremental_build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 3b0964f01866..264e1a524111 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,10 +29,11 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" +PLUGIN_SHARDING=($PLUGIN_SHARDING) if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" "$PLUGIN_SHARDING") + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else # Sets CHANGED_PACKAGES check_changed_packages @@ -40,10 +41,10 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" "$PLUGIN_SHARDING") + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" "$PLUGIN_SHARDING") + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) echo "Running version check for changed packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi From c003fd39e02a48502fea53747027d35e5a9504b5 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 23:04:33 -0700 Subject: [PATCH 11/11] fix --- .cirrus.yml | 308 ++++++++++++++++++------------------ script/incremental_build.sh | 5 +- 2 files changed, 157 insertions(+), 156 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5bf7803b223a..915f9f80a6a6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,59 +16,57 @@ task: - git fetch origin master activate_script: pub global activate flutter_plugin_tools matrix: - # - name: publishable - # script: - # - flutter channel master - # - ./script/check_publish.sh - # - name: format - # install_script: - # - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - # - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" - # - sudo apt-get update - # - sudo apt-get install -y --allow-unauthenticated clang-format-7 - # format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7 - # - name: test - # env: - # matrix: - # CHANNEL: "master" - # CHANNEL: "stable" - # test_script: - # # TODO(jackson): Allow web plugins once supported on stable - # # https://github.com/flutter/flutter/issues/42864 - # - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - # - flutter channel $CHANNEL - # - ./script/incremental_build.sh test - # - name: analyze - # script: ./script/incremental_build.sh analyze - # - name: build_all_plugins_apk - # script: - # # TODO(jackson): Allow web plugins once supported on stable - # # https://github.com/flutter/flutter/issues/42864 - # - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - # - flutter channel $CHANNEL - # - ./script/build_all_plugins_app.sh apk - # - name: e2e_web_smoke_test - # # Tests e2e example test in web. - # only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''" - # install_script: - # - flutter config --enable-web - # - git clone https://github.com/flutter/web_installers.git - # - cd web_installers/packages/web_drivers/ - # - pub get - # - dart lib/web_driver_installer.dart chromedriver --install-only - # - ./chromedriver/chromedriver --port=4444 & - # test_script: - # - cd $E2E_PATH/example/ - # - flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome + - name: publishable + script: + - flutter channel master + - ./script/check_publish.sh + - name: format + install_script: + - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" + - sudo apt-get update + - sudo apt-get install -y --allow-unauthenticated clang-format-7 + format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7 + - name: test + env: + matrix: + CHANNEL: "master" + CHANNEL: "stable" + test_script: + # TODO(jackson): Allow web plugins once supported on stable + # https://github.com/flutter/flutter/issues/42864 + - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + - flutter channel $CHANNEL + - ./script/incremental_build.sh test + - name: analyze + script: ./script/incremental_build.sh analyze + - name: build_all_plugins_apk + script: + # TODO(jackson): Allow web plugins once supported on stable + # https://github.com/flutter/flutter/issues/42864 + - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + - flutter channel $CHANNEL + - ./script/build_all_plugins_app.sh apk + - name: e2e_web_smoke_test + # Tests e2e example test in web. + only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''" + install_script: + - flutter config --enable-web + - git clone https://github.com/flutter/web_installers.git + - cd web_installers/packages/web_drivers/ + - pub get + - dart lib/web_driver_installer.dart chromedriver --install-only + - ./chromedriver/chromedriver --port=4444 & + test_script: + - cd $E2E_PATH/example/ + - flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome - name: build-apks+java-test+firebase-test-lab env: matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 6" - # PLUGIN_SHARDING: "--shardIndex 1 --shardCount 6" - # PLUGIN_SHARDING: "--shardIndex 2 --shardCount 6" - # PLUGIN_SHARDING: "--shardIndex 3 --shardCount 6" - # PLUGIN_SHARDING: "--shardIndex 4 --shardCount 6" - # PLUGIN_SHARDING: "--shardIndex 5 --shardCount 6" + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" matrix: CHANNEL: "master" CHANNEL: "stable" @@ -100,109 +98,109 @@ task: - export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt` - export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt` -# task: -# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins -# only_if: $CIRRUS_TAG == '' -# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' -# container: -# dockerfile: .ci/Dockerfile-LinuxDesktop -# cpu: 8 -# memory: 16G -# env: -# E2E_PATH: "./packages/e2e" -# upgrade_script: -# - flutter channel stable -# - flutter upgrade -# - flutter channel master -# - flutter upgrade -# - git fetch origin master -# activate_script: pub global activate flutter_plugin_tools -# matrix: -# - name: build-linux+drive-examples -# install_script: -# - flutter config --enable-linux-desktop -# build_script: -# # TODO(stuartmorgan): Include stable once Linux is supported on stable. -# - flutter channel master -# - ./script/incremental_build.sh build-examples --linux -# - xvfb-run ./script/incremental_build.sh drive-examples --linux +task: + # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins + only_if: $CIRRUS_TAG == '' + use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' + container: + dockerfile: .ci/Dockerfile-LinuxDesktop + cpu: 8 + memory: 16G + env: + E2E_PATH: "./packages/e2e" + upgrade_script: + - flutter channel stable + - flutter upgrade + - flutter channel master + - flutter upgrade + - git fetch origin master + activate_script: pub global activate flutter_plugin_tools + matrix: + - name: build-linux+drive-examples + install_script: + - flutter config --enable-linux-desktop + build_script: + # TODO(stuartmorgan): Include stable once Linux is supported on stable. + - flutter channel master + - ./script/incremental_build.sh build-examples --linux + - xvfb-run ./script/incremental_build.sh drive-examples --linux -# task: -# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins -# only_if: $CIRRUS_TAG == '' -# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' -# osx_instance: -# image: catalina-xcode-11.3.1-flutter -# upgrade_script: -# - flutter channel stable -# - flutter upgrade -# - flutter channel master -# - flutter upgrade -# - git fetch origin master -# activate_script: pub global activate flutter_plugin_tools -# create_simulator_script: -# - xcrun simctl list -# - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot -# matrix: -# - name: build_all_plugins_ipa -# script: -# # TODO(jackson): Allow web plugins once supported on stable -# # https://github.com/flutter/flutter/issues/42864 -# - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi -# - flutter channel $CHANNEL -# - ./script/build_all_plugins_app.sh ios --no-codesign -# - name: lint_darwin_plugins -# env: -# matrix: -# PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" -# PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" -# script: -# # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. -# - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm -# # Skip the dummy podspecs used to placate the tool. -# - find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm -# - ./script/incremental_build.sh podspecs -# - name: build-ipas+drive-examples -# env: -# PATH: $PATH:/usr/local/bin -# matrix: -# PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" -# PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" -# PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" -# PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" -# matrix: -# CHANNEL: "master" -# CHANNEL: "stable" -# SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] -# build_script: -# # TODO(jackson): Allow web plugins once supported on stable -# # https://github.com/flutter/flutter/issues/42864 -# - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi -# - flutter channel $CHANNEL -# - ./script/incremental_build.sh build-examples --ipa -# - ./script/incremental_build.sh drive-examples -# task: -# # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins -# only_if: $CIRRUS_TAG == '' -# use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' -# osx_instance: -# image: catalina-xcode-11.3.1-flutter -# setup_script: -# - flutter config --enable-macos-desktop -# upgrade_script: -# - flutter channel master -# - flutter upgrade -# - git fetch origin master -# activate_script: pub global activate flutter_plugin_tools -# matrix: -# - name: build_all_plugins_app -# script: -# - flutter channel master -# - ./script/build_all_plugins_app.sh macos -# - name: build-apps+drive-examples -# env: -# PATH: $PATH:/usr/local/bin -# build_script: -# - flutter channel master -# - ./script/incremental_build.sh build-examples --macos --no-ipa -# - ./script/incremental_build.sh drive-examples --macos +task: + # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins + only_if: $CIRRUS_TAG == '' + use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' + osx_instance: + image: catalina-xcode-11.3.1-flutter + upgrade_script: + - flutter channel stable + - flutter upgrade + - flutter channel master + - flutter upgrade + - git fetch origin master + activate_script: pub global activate flutter_plugin_tools + create_simulator_script: + - xcrun simctl list + - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot + matrix: + - name: build_all_plugins_ipa + script: + # TODO(jackson): Allow web plugins once supported on stable + # https://github.com/flutter/flutter/issues/42864 + - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + - flutter channel $CHANNEL + - ./script/build_all_plugins_app.sh ios --no-codesign + - name: lint_darwin_plugins + env: + matrix: + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" + script: + # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. + - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm + # Skip the dummy podspecs used to placate the tool. + - find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm + - ./script/incremental_build.sh podspecs + - name: build-ipas+drive-examples + env: + PATH: $PATH:/usr/local/bin + matrix: + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] + build_script: + # TODO(jackson): Allow web plugins once supported on stable + # https://github.com/flutter/flutter/issues/42864 + - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi + - flutter channel $CHANNEL + - ./script/incremental_build.sh build-examples --ipa + - ./script/incremental_build.sh drive-examples +task: + # don't run on release tags since it creates O(n^2) tasks where n is the number of plugins + only_if: $CIRRUS_TAG == '' + use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' + osx_instance: + image: catalina-xcode-11.3.1-flutter + setup_script: + - flutter config --enable-macos-desktop + upgrade_script: + - flutter channel master + - flutter upgrade + - git fetch origin master + activate_script: pub global activate flutter_plugin_tools + matrix: + - name: build_all_plugins_app + script: + - flutter channel master + - ./script/build_all_plugins_app.sh macos + - name: build-apps+drive-examples + env: + PATH: $PATH:/usr/local/bin + build_script: + - flutter channel master + - ./script/incremental_build.sh build-examples --macos --no-ipa + - ./script/incremental_build.sh drive-examples --macos diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 264e1a524111..ba8bf938d593 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -ex +set -e readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" readonly REPO_DIR="$(dirname "$SCRIPT_DIR")" @@ -29,6 +29,9 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" + +# This has to be turned into a list and then split out to the command line, +# otherwise it gets treated as a single argument. PLUGIN_SHARDING=($PLUGIN_SHARDING) if [[ "${BRANCH_NAME}" == "master" ]]; then