blob: c97c8898430475acfeb5655ef0d87a22d208cb02 [file] [log] [blame]
gcp_credentials: ENCRYPTED[!ebad0a1f4f7a446b77944c33651460a7ab010b4617273cb016cf354eb8fc22aa92e37a3c58bfa4a0c40a799351e027a6!]
# Don't re-run tests for tags when releasing a package.
# Don't run on 'master' since it's a mirror of 'main'.
only_if: $CIRRUS_TAG == '' && $CIRRUS_BRANCH != 'master'
env:
CHANNEL: "master" # Default to master when not explicitly set by a task.
install_chrome_linux_template: &INSTALL_CHROME_LINUX
env:
CHROME_NO_SANDBOX: true
CHROME_DOWNLOAD_DIR: /tmp/chromium
CHROME_EXECUTABLE: $CHROME_DOWNLOAD_DIR/chrome-linux/chrome
CHROMEDRIVER_EXECUTABLE: $CHROME_DOWNLOAD_DIR/chromedriver/chromedriver
PATH: $PATH:$CHROME_DOWNLOAD_DIR/chrome-linux
install_chromium_script:
# Install a pinned version of Chromium and its corresponding ChromeDriver.
# Setting CHROME_EXECUTABLE above causes this version to be used for tests.
- ./script/install_chromium.sh "$CHROME_DIR"
tool_setup_template: &TOOL_SETUP_TEMPLATE
tool_setup_script:
- .ci/scripts/prepare_tool.sh
macos_template: &MACOS_TEMPLATE
# Only one macOS task can run in parallel without credits, so use them for
# PRs on macOS.
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: big-sur-xcode-13
flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
upgrade_flutter_script:
# Master uses a pinned, auto-rolled version to prevent out-of-band CI
# failures due to changes in Flutter.
# TODO(stuartmorgan): Investigate an autoroller for stable as well.
- TARGET_TREEISH=$CHANNEL
- if [[ "$CHANNEL" == "master" ]]; then
- TARGET_TREEISH=$(< .ci/flutter_$CHANNEL.version)
- fi
# Ensure that the repository has all the branches.
- cd $FLUTTER_HOME
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
# Switch to the requested channel.
- git checkout $TARGET_TREEISH
# When using a branch rather than a hash or version tag, reset to the
# upstream branch rather than using pull, since the base image can sometimes
# be in a state where it has diverged from upstream (!).
- if [[ "$TARGET_TREEISH" == "$CHANNEL" ]] && [[ "$CHANNEL" != *"."* ]]; then
- git reset --hard @{u}
- fi
# Run doctor to allow auditing of what version of Flutter the run is using.
- flutter doctor -v
<< : *TOOL_SETUP_TEMPLATE
task:
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder-linux # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
namespace: default
cpu: 4
memory: 8G
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
### Platform-agnostic tasks ###
- name: format+analyze
always:
format_script: ./script/tool_runner.sh format --fail-on-change
license_script: dart pub global run flutter_plugin_tools license-check
analyze_script: ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
pubspec_script: ./script/tool_runner.sh pubspec-check
readme_script:
- ./script/tool_runner.sh readme-check
# Re-run with --require-excerpts, skipping packages that still need
# to be converted. Once https://github.com/flutter/flutter/issues/102679
# has been fixed, this can be removed and there can just be a single
# run with --require-excerpts and no exclusions.
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
- name: readme_excerpts
env:
CIRRUS_CLONE_SUBMODULES: true
script: ./script/tool_runner.sh update-excerpts --fail-on-change
# Does a sanity check that packages at least pass analysis on the N-1 and N-2
# versions of Flutter stable if the package claims to support that version.
# This is to minimize accidentally making changes that break old versions
# (which we don't commit to supporting, but don't want to actively break)
# without updating the constraints.
# Note: The versions below should be manually updated after a new stable
# version comes out.
- name: legacy-version-analyze
depends_on: format+analyze
env:
matrix:
CHANNEL: "2.10.5"
CHANNEL: "2.8.1"
analyze_script:
# Exclude:
# - flutter_lints: does not depend on flutter, is only constrained by
# Dart SDK version.
- ./script/tool_runner.sh analyze --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml --exclude=flutter_lints
- name: publishable
env:
# TODO(stuartmorgan): Remove once the fix for https://github.com/dart-lang/pub/issues/3152
# rolls into Flutter master.
CHANNEL: stable
CHANGE_DESC: "/tmp/change-description.txt"
version_script:
# For pre-submit, pass the PR description to the script to allow for
# version check overrides.
# For post-submit, ignore missing version/CHANGELOG detection; the PR
# description isn't reliably part of the commit message, so using the
# same flags as for presubmit would likely result in false-positive
# post-submit failures.
- if [[ $CIRRUS_PR == "" ]]; then
- ./script/tool_runner.sh version-check
- else
- echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC"
- ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC"
- fi
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
depends_on:
- format+analyze
- name: dart_unit_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# We exclude flutter_image because its tests need a test server, so are run via custom_package_tests.
- ./script/tool_runner.sh test --exclude=flutter_image
depends_on:
- format+analyze
- name: linux-custom_package_tests
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *INSTALL_CHROME_LINUX
local_tests_script:
# pigeon tests currently don't support Linux:
# https://github.com/flutter/flutter/issues/100386
# flutter_image
# https://github.com/flutter/flutter/issues/100387
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh custom-test --exclude=pigeon
- else
- ./script/tool_runner.sh custom-test --exclude=pigeon,flutter_image
- fi
### Android tasks ###
- name: android-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
# extension_google_sign_in_as_googleapis_auth is currently not building, see
# https://github.com/flutter/flutter/issues/89301
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
native_unit_test_scipt:
- ./script/tool_runner.sh native-test --android --no-integration
depends_on:
- format+analyze
### Web tasks ###
- name: web-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *INSTALL_CHROME_LINUX
chromedriver_background_script:
- $CHROMEDRIVER_EXECUTABLE --port=4444
build_script:
- ./script/tool_runner.sh build-examples --web
drive_script:
- ./script/tool_runner.sh drive-examples --web
- name: web_benchmarks_test
env:
matrix:
CHROMIUM_BUILD: "768968" # Chromium 84.0.4147.0
CHROMIUM_BUILD: "950363" # Chromium 98.0.4758.0
<< : *INSTALL_CHROME_LINUX
script:
- cd packages/web_benchmarks/testing/test_app
- flutter packages get
- cd ../..
- flutter packages get
- dart testing/web_benchmarks_test.dart
### Linux desktop tasks ###
- name: linux-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
- flutter config --enable-linux-desktop
- ./script/tool_runner.sh build-examples --linux
native_test_script:
- ./script/tool_runner.sh native-test --linux --no-integration
task:
<< : *MACOS_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
### iOS tasks ###
- name: ios-platform_tests
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-0 | xargs xcrun simctl boot
build_script:
- ./script/tool_runner.sh build-examples --ios
native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
- name: ios-custom_package_tests
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
local_tests_script:
# flutter_image
# https://github.com/flutter/flutter/issues/100387
# cross_file
# Custom tests need Chrome. (They run in linux-custom_package_tests)
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh custom-test --exclude=cross_file
- else
- ./script/tool_runner.sh custom-test --exclude=cross_file,flutter_image
- fi
### macOS desktop tasks ###
- name: macos-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
PATH: $PATH:/usr/local/bin
build_script:
- flutter config --enable-macos-desktop
- ./script/tool_runner.sh build-examples --macos
native_test_script:
- ./script/tool_runner.sh native-test --macos