blob: bce57a1b09b20e020f9828fe3a4d86ae60ec3e14 [file] [log] [blame]
gcp_credentials: ENCRYPTED[!2c88dee9c9d9805b214c9f7ad8f3bc8fae936cdb0f881d562101151c408c7e024a41222677d5831df90c60d2dd6cd80a!]
env:
CHANNEL: "master" # Default to master when not explicitly set by a task.
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:
- 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
# 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.5.3"
CHANNEL: "2.8.1"
analyze_script:
- ./script/tool_runner.sh analyze --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml
- 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: test
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# Exclude:
# - flutter_image; its tests need a test server, so are run via
# local_tests.sh.
# - rfw on stable; it includes golden tests whose results differ
# between branch
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh test --exclude=flutter_image
- else
- ./script/tool_runner.sh test --exclude=flutter_image,rfw
- fi
depends_on:
- format+analyze
- name: android-build+platform-tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# extension_google_sign_in_as_googleapis_auth is currently not building, see
# https://github.com/flutter/flutter/issues/89301
# rfw is excluded until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the ios tests below.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
- ./script/tool_runner.sh native-test --android --no-integration
- else
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth,rfw
- ./script/tool_runner.sh native-test --android --no-integration --exclude=rfw
- fi
depends_on:
- format+analyze
- name: web_benchmarks_test
env:
matrix:
CHROMIUM_BUILD: "768968" # Chromium 84.0.4147.0
CHROMIUM_BUILD: "950363" # Chromium 98.0.4758.0
CHROME_NO_SANDBOX: true
install_chromium_script:
- ./script/install_chromium.sh
script:
- export CHROME_EXECUTABLE=$(pwd)/.chromium/chrome-linux/chrome
- cd packages/web_benchmarks/testing/test_app
- flutter packages get
- cd ../..
- flutter packages get
- dart testing/web_benchmarks_test.dart
task:
<< : *MACOS_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
- name: ios-build+platform-test
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
# Exclude rfw until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the android tests above.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --ios
- else
- ./script/tool_runner.sh build-examples --ios --exclude=rfw
- fi
- name: local_tests
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
local_tests_script:
- ./script/local_tests.sh