mirror of
https://github.com/flutter/packages.git
synced 2025-06-27 04:37:07 +08:00
[ci] Cirrus pre-alignment with flutter/plugins, part 1 (#2706)
This commit is contained in:
175
.cirrus.yml
175
.cirrus.yml
@ -4,6 +4,7 @@ gcp_credentials: ENCRYPTED[!f1177d1ddb5330ffaa9ea11c9c9e8e0c542185e895c36071f18c
|
|||||||
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
|
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
|
||||||
env:
|
env:
|
||||||
CHANNEL: "master" # Default to master when not explicitly set by a task.
|
CHANNEL: "master" # Default to master when not explicitly set by a task.
|
||||||
|
PLUGIN_TOOL_COMMAND: "dart pub global run flutter_plugin_tools"
|
||||||
|
|
||||||
install_chrome_linux_template: &INSTALL_CHROME_LINUX
|
install_chrome_linux_template: &INSTALL_CHROME_LINUX
|
||||||
env:
|
env:
|
||||||
@ -25,6 +26,14 @@ macos_template: &MACOS_TEMPLATE
|
|||||||
# Only one macOS task can run in parallel without credits, so use them for
|
# Only one macOS task can run in parallel without credits, so use them for
|
||||||
# PRs on macOS.
|
# PRs on macOS.
|
||||||
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
|
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
|
||||||
|
|
||||||
|
macos_intel_template: &MACOS_INTEL_TEMPLATE
|
||||||
|
<< : *MACOS_TEMPLATE
|
||||||
|
osx_instance:
|
||||||
|
image: big-sur-xcode-13
|
||||||
|
|
||||||
|
macos_arm_template: &MACOS_ARM_TEMPLATE
|
||||||
|
<< : *MACOS_TEMPLATE
|
||||||
macos_instance:
|
macos_instance:
|
||||||
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
|
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
|
||||||
|
|
||||||
@ -53,7 +62,11 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
|
|||||||
- flutter doctor -v
|
- flutter doctor -v
|
||||||
<< : *TOOL_SETUP_TEMPLATE
|
<< : *TOOL_SETUP_TEMPLATE
|
||||||
|
|
||||||
|
# Light-workload Linux tasks.
|
||||||
|
# These use default machines, with fewer CPUs, to reduce pressure on the
|
||||||
|
# concurrency limits.
|
||||||
task:
|
task:
|
||||||
|
<< : *FLUTTER_UPGRADE_TEMPLATE
|
||||||
gke_container:
|
gke_container:
|
||||||
dockerfile: .ci/Dockerfile
|
dockerfile: .ci/Dockerfile
|
||||||
builder_image_name: docker-builder-linux # gce vm image
|
builder_image_name: docker-builder-linux # gce vm image
|
||||||
@ -61,28 +74,15 @@ task:
|
|||||||
cluster_name: test-cluster
|
cluster_name: test-cluster
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
namespace: default
|
namespace: default
|
||||||
cpu: 4
|
|
||||||
memory: 12G
|
|
||||||
<< : *FLUTTER_UPGRADE_TEMPLATE
|
|
||||||
matrix:
|
matrix:
|
||||||
### Platform-agnostic tasks ###
|
### Platform-agnostic tasks ###
|
||||||
- name: format+analyze
|
# Repository rules and best-practice enforcement.
|
||||||
|
# Only channel-agnostic tests should go here since it is only run once
|
||||||
|
# (on Flutter master).
|
||||||
|
- name: repo_checks
|
||||||
always:
|
always:
|
||||||
format_script: ./script/tool_runner.sh format --fail-on-change
|
format_script: ./script/tool_runner.sh format --fail-on-change
|
||||||
license_script: dart pub global run flutter_plugin_tools license-check
|
license_script: $PLUGIN_TOOL_COMMAND license-check
|
||||||
analyze_script:
|
|
||||||
- ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
|
|
||||||
pathified_analyze_script:
|
|
||||||
# Run analysis with path-based dependencies to ensure that publishing
|
|
||||||
# the changes won't break analysis of other packages in the respository
|
|
||||||
# that depend on it.
|
|
||||||
- ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates
|
|
||||||
# This uses --run-on-dirty-packages rather than --packages-for-branch
|
|
||||||
# since only the packages changed by 'make-deps-path-based' need to be
|
|
||||||
# checked.
|
|
||||||
- dart pub global run flutter_plugin_tools analyze --run-on-dirty-packages --custom-analysis=script/configs/custom_analysis.yaml
|
|
||||||
# Restore the tree to a clean state
|
|
||||||
- git checkout .
|
|
||||||
pubspec_script: ./script/tool_runner.sh pubspec-check
|
pubspec_script: ./script/tool_runner.sh pubspec-check
|
||||||
readme_script:
|
readme_script:
|
||||||
- ./script/tool_runner.sh readme-check
|
- ./script/tool_runner.sh readme-check
|
||||||
@ -91,56 +91,18 @@ task:
|
|||||||
# has been fixed, this can be removed and there can just be a single
|
# has been fixed, this can be removed and there can just be a single
|
||||||
# run with --require-excerpts and no exclusions.
|
# run with --require-excerpts and no exclusions.
|
||||||
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
|
- ./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
|
|
||||||
matrix:
|
|
||||||
env:
|
|
||||||
CHANNEL: "3.0.5"
|
|
||||||
DART_VERSION: "2.17.6"
|
|
||||||
env:
|
|
||||||
CHANNEL: "2.10.5"
|
|
||||||
DART_VERSION: "2.16.2"
|
|
||||||
package_prep_script:
|
|
||||||
# Allow analyzing packages that use a dev dependency with a higher
|
|
||||||
# minimum Flutter/Dart version than the package itself.
|
|
||||||
- ./script/tool_runner.sh remove-dev-dependencies
|
|
||||||
analyze_script:
|
|
||||||
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --skip-if-not-supporting-dart-version="$DART_VERSION" --custom-analysis=script/configs/custom_analysis.yaml
|
|
||||||
# Does a sanity check that packages pass analysis with the lowest possible
|
|
||||||
# versions of all dependencies. This is to catch cases where we add use of
|
|
||||||
# new APIs but forget to update minimum versions of dependencies to where
|
|
||||||
# those APIs are introduced.
|
|
||||||
- name: downgraded_analyze
|
|
||||||
depends_on: format+analyze
|
|
||||||
analyze_script:
|
|
||||||
- ./script/tool_runner.sh analyze --downgrade --custom-analysis=script/configs/custom_analysis.yaml
|
|
||||||
- name: publishable
|
|
||||||
version_script:
|
version_script:
|
||||||
# For pre-submit, pass the PR description to the script to allow for
|
# For pre-submit, pass the PR labels to the script to allow for
|
||||||
# version check overrides.
|
# check overrides.
|
||||||
# For post-submit, ignore missing version/CHANGELOG detection; the PR
|
# For post-submit, ignore platform version breaking version changes
|
||||||
# description isn't reliably part of the commit message, so using the
|
# and missing version/CHANGELOG detection since the labels aren't
|
||||||
# same flags as for presubmit would likely result in false-positive
|
# available outside of the context of the PR.
|
||||||
# post-submit failures.
|
|
||||||
- if [[ $CIRRUS_PR == "" ]]; then
|
- if [[ $CIRRUS_PR == "" ]]; then
|
||||||
- ./script/tool_runner.sh version-check
|
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
|
||||||
- else
|
- else
|
||||||
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
|
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
|
||||||
- fi
|
- fi
|
||||||
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
|
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
|
||||||
depends_on:
|
|
||||||
- format+analyze
|
|
||||||
- name: dart_unit_tests
|
- name: dart_unit_tests
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
@ -153,9 +115,62 @@ task:
|
|||||||
# the changes won't break tests of other packages in the respository
|
# the changes won't break tests of other packages in the respository
|
||||||
# that depend on it.
|
# that depend on it.
|
||||||
- ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates
|
- ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates
|
||||||
- dart pub global run flutter_plugin_tools test --run-on-dirty-packages --exclude=script/configs/dart_unit_tests_exceptions.yaml
|
- $PLUGIN_TOOL_COMMAND test --run-on-dirty-packages --exclude=script/configs/dart_unit_tests_exceptions.yaml
|
||||||
depends_on:
|
- name: analyze
|
||||||
- format+analyze
|
env:
|
||||||
|
matrix:
|
||||||
|
CHANNEL: "master"
|
||||||
|
CHANNEL: "stable"
|
||||||
|
analyze_script:
|
||||||
|
- ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
|
||||||
|
pathified_analyze_script:
|
||||||
|
# Re-run analysis with path-based dependencies to ensure that publishing
|
||||||
|
# the changes won't break analysis of other packages in the respository
|
||||||
|
# that depend on it.
|
||||||
|
- ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates
|
||||||
|
# This uses --run-on-dirty-packages rather than --packages-for-branch
|
||||||
|
# since only the packages changed by 'make-deps-path-based' need to be
|
||||||
|
# checked.
|
||||||
|
- $PLUGIN_TOOL_COMMAND analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml
|
||||||
|
# Restore the tree to a clean state, to avoid accidental issues if
|
||||||
|
# other script steps are added to this task.
|
||||||
|
- git checkout .
|
||||||
|
# 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: analyze
|
||||||
|
matrix:
|
||||||
|
env:
|
||||||
|
CHANNEL: "3.0.5"
|
||||||
|
DART_VERSION: "2.17.6"
|
||||||
|
env:
|
||||||
|
CHANNEL: "2.10.5"
|
||||||
|
DART_VERSION: "2.16.2"
|
||||||
|
package_prep_script:
|
||||||
|
# Allow analyzing packages that use a dev dependency with a higher
|
||||||
|
# minimum Flutter/Dart version than the package itself.
|
||||||
|
- ./script/tool_runner.sh remove-dev-dependencies
|
||||||
|
analyze_script:
|
||||||
|
# Only analyze lib/; non-client code doesn't need to work on
|
||||||
|
# all supported legacy version.
|
||||||
|
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --skip-if-not-supporting-dart-version="$DART_VERSION" --custom-analysis=script/configs/custom_analysis.yaml
|
||||||
|
# Does a sanity check that packages pass analysis with the lowest possible
|
||||||
|
# versions of all dependencies. This is to catch cases where we add use of
|
||||||
|
# new APIs but forget to update minimum versions of dependencies to where
|
||||||
|
# those APIs are introduced.
|
||||||
|
- name: downgraded_analyze
|
||||||
|
depends_on: analyze
|
||||||
|
analyze_script:
|
||||||
|
- ./script/tool_runner.sh analyze --downgrade --custom-analysis=script/configs/custom_analysis.yaml
|
||||||
|
- name: readme_excerpts
|
||||||
|
env:
|
||||||
|
CIRRUS_CLONE_SUBMODULES: true
|
||||||
|
script: ./script/tool_runner.sh update-excerpts --fail-on-change
|
||||||
- name: linux-custom_package_tests
|
- name: linux-custom_package_tests
|
||||||
env:
|
env:
|
||||||
PATH: $PATH:/usr/local/bin
|
PATH: $PATH:/usr/local/bin
|
||||||
@ -173,8 +188,26 @@ task:
|
|||||||
- else
|
- else
|
||||||
- ./script/tool_runner.sh custom-test --exclude=pigeon,flutter_image
|
- ./script/tool_runner.sh custom-test --exclude=pigeon,flutter_image
|
||||||
- fi
|
- fi
|
||||||
|
|
||||||
|
# Heavy-workload Linux tasks.
|
||||||
|
# These use machines with more CPUs and memory, so will reduce parallelization
|
||||||
|
# for non-credit runs.
|
||||||
|
task:
|
||||||
|
<< : *FLUTTER_UPGRADE_TEMPLATE
|
||||||
|
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: 12G
|
||||||
|
matrix:
|
||||||
### Android tasks ###
|
### Android tasks ###
|
||||||
- name: android-platform_tests
|
- name: android-platform_tests
|
||||||
|
# Don't run full platform tests on both channels in pre-submit.
|
||||||
|
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
PACKAGE_SHARDING: "--shardIndex 0 --shardCount 2"
|
PACKAGE_SHARDING: "--shardIndex 0 --shardCount 2"
|
||||||
@ -188,8 +221,6 @@ task:
|
|||||||
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
|
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
|
||||||
native_unit_test_scipt:
|
native_unit_test_scipt:
|
||||||
- ./script/tool_runner.sh native-test --android --no-integration
|
- ./script/tool_runner.sh native-test --android --no-integration
|
||||||
depends_on:
|
|
||||||
- format+analyze
|
|
||||||
### Web tasks ###
|
### Web tasks ###
|
||||||
- name: web-platform_tests
|
- name: web-platform_tests
|
||||||
env:
|
env:
|
||||||
@ -217,22 +248,25 @@ task:
|
|||||||
- dart testing/web_benchmarks_test.dart
|
- dart testing/web_benchmarks_test.dart
|
||||||
### Linux desktop tasks ###
|
### Linux desktop tasks ###
|
||||||
- name: linux-platform_tests
|
- name: linux-platform_tests
|
||||||
|
# Don't run full platform tests on both channels in pre-submit.
|
||||||
|
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
CHANNEL: "master"
|
CHANNEL: "master"
|
||||||
CHANNEL: "stable"
|
CHANNEL: "stable"
|
||||||
build_script:
|
build_script:
|
||||||
- flutter config --enable-linux-desktop
|
|
||||||
- ./script/tool_runner.sh build-examples --linux
|
- ./script/tool_runner.sh build-examples --linux
|
||||||
native_test_script:
|
native_test_script:
|
||||||
- ./script/tool_runner.sh native-test --linux --no-integration
|
- ./script/tool_runner.sh native-test --linux --no-integration
|
||||||
|
|
||||||
task:
|
task:
|
||||||
<< : *FLUTTER_UPGRADE_TEMPLATE
|
<< : *FLUTTER_UPGRADE_TEMPLATE
|
||||||
<< : *MACOS_TEMPLATE
|
<< : *MACOS_ARM_TEMPLATE
|
||||||
matrix:
|
matrix:
|
||||||
### iOS tasks ###
|
### iOS tasks ###
|
||||||
- name: ios-platform_tests
|
- name: ios-platform_tests
|
||||||
|
# Don't run full platform tests on both channels in pre-submit.
|
||||||
|
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
|
||||||
env:
|
env:
|
||||||
PATH: $PATH:/usr/local/bin
|
PATH: $PATH:/usr/local/bin
|
||||||
matrix:
|
matrix:
|
||||||
@ -264,13 +298,14 @@ task:
|
|||||||
- fi
|
- fi
|
||||||
### macOS desktop tasks ###
|
### macOS desktop tasks ###
|
||||||
- name: macos-platform_tests
|
- name: macos-platform_tests
|
||||||
|
# Don't run full platform tests on both channels in pre-submit.
|
||||||
|
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
CHANNEL: "master"
|
CHANNEL: "master"
|
||||||
CHANNEL: "stable"
|
CHANNEL: "stable"
|
||||||
PATH: $PATH:/usr/local/bin
|
PATH: $PATH:/usr/local/bin
|
||||||
build_script:
|
build_script:
|
||||||
- flutter config --enable-macos-desktop
|
|
||||||
- ./script/tool_runner.sh build-examples --macos
|
- ./script/tool_runner.sh build-examples --macos
|
||||||
native_test_script:
|
native_test_script:
|
||||||
- ./script/tool_runner.sh native-test --macos
|
- ./script/tool_runner.sh native-test --macos
|
||||||
|
@ -77,7 +77,7 @@ linter:
|
|||||||
# - cascade_invocations # doesn't match the typical style of this repo
|
# - cascade_invocations # doesn't match the typical style of this repo
|
||||||
- cast_nullable_to_non_nullable
|
- cast_nullable_to_non_nullable
|
||||||
# - close_sinks # not reliable enough
|
# - close_sinks # not reliable enough
|
||||||
- combinators_ordering
|
# - combinators_ordering # DIFFERENT FROM FLUTTER/FLUTTER: This isn't available on stable yet.
|
||||||
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
|
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
|
||||||
- conditional_uri_does_not_exist
|
- conditional_uri_does_not_exist
|
||||||
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
|
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
|
||||||
|
Reference in New Issue
Block a user