Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

WIP Reduce CI testing time, add caching #2357

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
507c44a
Remove pod setup
jmagman Dec 5, 2019
1206251
Remove repo remove
jmagman Dec 6, 2019
e9cd4ef
Rearrange .cirrus script, add cache
jmagman Dec 6, 2019
426532b
Indent
jmagman Dec 6, 2019
5d75a70
{
jmagman Dec 6, 2019
b66e3c8
Remove cache
jmagman Dec 6, 2019
eac5365
Remove cache
jmagman Dec 6, 2019
436aad4
Rename script
jmagman Dec 6, 2019
c95c9d2
BASE_TASK_TEMPLATE
jmagman Dec 6, 2019
3a1ff30
Remove CIRRUS_WORKING_DIR
jmagman Dec 6, 2019
fc3c4ad
Change fingerprint
jmagman Dec 6, 2019
9f35317
single
jmagman Dec 6, 2019
918adf9
fingerprint
jmagman Dec 6, 2019
54e4bbe
FLUTTER_TEMPLATE
jmagman Dec 6, 2019
153db2b
BASE_TASK_TEMPLATE
jmagman Dec 6, 2019
5294d39
Test fingerprint_script outside of template
jmagman Dec 6, 2019
e3ced2a
extension-methods
jmagman Dec 6, 2019
0d18153
**
jmagman Dec 6, 2019
3cf307d
fi
jmagman Dec 6, 2019
860f5a1
Remove format dependency
jmagman Dec 6, 2019
ac73cd0
Swap to master
jmagman Dec 6, 2019
693b1bf
FLUTTER_TEMPLATE
jmagman Dec 6, 2019
1f436b5
Reduce number of templates
jmagman Dec 6, 2019
98423d4
Rearrange matrix
jmagman Dec 6, 2019
fac97be
Try only_if
jmagman Dec 6, 2019
9121781
Rearrange matrix
jmagman Dec 6, 2019
8314d64
Rearrange matrix
jmagman Dec 6, 2019
901cd92
pub_cache
jmagman Dec 6, 2019
d1f2ce4
Well only_if didn't work...
jmagman Dec 6, 2019
c643da5
Cache all the things
jmagman Dec 7, 2019
bf81f69
Add channel to fingerprint
jmagman Dec 7, 2019
773e81f
channel_script
jmagman Dec 7, 2019
672030a
Remove all caches
jmagman Dec 7, 2019
d12b38d
Clear flutter cache
jmagman Dec 7, 2019
41147b0
FLUTTER_HOME is there, rm the cache
jmagman Dec 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 68 additions & 37 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,73 @@
flutter_skip_web_template: &FLUTTER_SKIP_WEB_TEMPLATE
remove_web_plugins_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

task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == ''
container:
dockerfile: .ci/Dockerfile
cpu: 8
memory: 16G
environment:
PATH: $PATH:$HOME/.pub-cache/bin
CHANNEL: "master" # Default to flutter master, tests can override.
channel_script:
- flutter channel $CHANNEL
- rm -rf $FLUTTER_HOME/bin/cache/*
# flutter_pkg_cache:
# folder: $FLUTTER_HOME/bin/cache/pkg
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/internal/*.version
# flutter_artifacts_cache:
# folder: $FLUTTER_HOME/bin/cache/artifacts
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/internal/*.version
# dart_cache:
# folder: $FLUTTER_HOME/bin/cache/dart-sdk
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/internal/*.version
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: publishable
environment:
CHANNEL: "stable"
script:
- flutter channel stable
- ./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
- dpkg -L clang-format-7
format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7
- name: test
env:
<< : *FLUTTER_SKIP_WEB_TEMPLATE
environment:
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
# depends_on:
# - publishable # Upload the stable cache first.
# - format # Upload the master cache first.
- name: analyze
script: ./script/incremental_build.sh analyze
script:
- ./script/incremental_build.sh analyze
# depends_on:
# - format # Upload the master cache first.
- name: build_all_plugins_apk
<< : *FLUTTER_SKIP_WEB_TEMPLATE
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
# depends_on:
# - format # Upload the master cache first.
- name: build-apks+java-test+firebase-test-lab
env:
<< : *FLUTTER_SKIP_WEB_TEMPLATE
environment:
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
Expand All @@ -54,10 +77,6 @@ task:
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[07586610af1fdfc894e5969f70ef2458341b9b7e9c3b7c4225a663b4a48732b7208a4d91c3b7d45305a6b55fa2a37fc4]
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
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# See: https://github.com/flutter/flutter/issues/24935
Expand All @@ -78,36 +97,49 @@ task:
- fi
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
# depends_on:
# - publishable
# - format

task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: mojave-xcode-11.2.1-flutter
setup_script:
- pod repo update
image: mojave-flutter
environment:
COCOAPODS_DISABLE_STATS: true
PATH: $PATH:/usr/local/bin:$HOME/.pub-cache/bin
CHANNEL: "master" # Default to flutter master, tests can override.
channel_script:
- flutter channel $CHANNEL
- rm -rf $FLUTTER_HOME/bin/cache/*
# flutter_pkg_cache:
# folder: $FLUTTER_HOME/bin/cache/pkg
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/internal/*.version
# flutter_artifacts_cache:
# folder: $FLUTTER_HOME/bin/cache/artifacts
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/internal/*.version
# dart_cache:
# folder: $FLUTTER_HOME/bin/cache/dart-sdk
# fingerprint_script: echo $OS; cat ${FLUTTER_HOME}/bin/cache/dart-sdk/revision
upgrade_script:
- flutter channel stable
- flutter upgrade
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
<< : *FLUTTER_SKIP_WEB_TEMPLATE
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-2 | 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
script: ./script/lint_darwin_plugins.sh
environment:
CHANNEL: "stable"
script:
- ./script/lint_darwin_plugins.sh
- name: build-ipas+drive-examples
env:
PATH: $PATH:/usr/local/bin
environment:
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
Expand All @@ -117,10 +149,9 @@ task:
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:
- ./script/incremental_build.sh build-examples --ipa
- ./script/incremental_build.sh drive-examples
# depends_on:
# - build_all_plugins_ipa # Upload the master cache first.
# - lint_darwin_plugins # Upload the stable cache first.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ analyzer:
exclude:
# Ignore generated files
- '**/*.g.dart'
- 'lib/src/generated/*.dart'
- '**/lib/src/generated/*.dart'
linter:
rules:
- public_member_api_docs