.cirrus.yml 8.22 KB
Newer Older
1
# CIRRUS CONFIGURATION FILE
2
# https://cirrus-ci.org/guide/writing-tasks/
3

4 5 6 7 8 9 10 11 12 13 14
environment:
  # For details about environment variables used in Cirrus, including how encrypted variables work,
  # see https://cirrus-ci.org/guide/writing-tasks/#environment-variables
  # We change Flutter's directory to include a space in its name (see $CIRRUS_WORKING_DIR) so that
  # we constantly test path names with spaces in them. The FLUTTER_SDK_PATH_WITH_SPACE variable must
  # therefore have a space in it.
  FLUTTER_SDK_PATH_WITH_SPACE: "flutter sdk"
  # We force BOT to true so that all our tools know we're in a CI environment. This avoids any
  # dependency on precisely how Cirrus is detected by our tools.
  BOT: "true"

15
gcp_credentials: ENCRYPTED[!cc769765170bebc37e0556e2da5915ca64ee37f4ec8c966ec147e2f59578b476c99e457eafce4e2f8b1a4e305f7096b8!]
16

17
# LINUX SHARDS
18
task:
19
  gke_container:
20
    dockerfile: "dev/ci/docker_linux/Dockerfile"
21 22
    builder_image_name: docker-builder # gce vm image
    builder_image_project: flutter-cirrus
godofredoc's avatar
godofredoc committed
23
    cluster_name: test-cluster
24 25
    zone: us-central1-a
    namespace: default
26 27
    cpu: $CPU
    memory: $MEMORY
28
    use_in_memory_disk: $USE_IN_MEMORY_DISK
29 30 31 32 33 34 35 36 37
  environment:
    # We shrink our default resource requirement as much as possible because that way we are more
    # likely to get scheduled. We require 4G of RAM because most of the shards (all but one as of
    # October 2019) just get OOM-killed with less. Some shards may need more. When increasing the
    # requirements for select shards, please leave a comment on those shards saying when you
    # increased the requirements, what numbers you tried, and what the results were.
    CPU: 1 # 0.1-8 without compute credits, 0.1-30 with (yes, you can go fractional)
    MEMORY: 4G # 256M-24G without compute credits, 256M-90G with
    CIRRUS_WORKING_DIR: "/tmp/$FLUTTER_SDK_PATH_WITH_SPACE"
38
    CIRRUS_DOCKER_CONTEXT: "dev/"
39
    PATH: "$CIRRUS_WORKING_DIR/bin:$CIRRUS_WORKING_DIR/bin/cache/dart-sdk/bin:$PATH"
40
    ANDROID_SDK_ROOT: "/opt/android_sdk"
41
    SHOULD_UPDATE_PACKAGES: 'TRUE' # can be overridden at the task level
42
    USE_IN_MEMORY_DISK: false
43 44 45
  pub_cache:
    folder: $HOME/.pub-cache
    fingerprint_script: echo $OS; grep -r --include=pubspec.yaml 'PUBSPEC CHECKSUM' "$CIRRUS_WORKING_DIR"
46
    reupload_on_changes: false
47 48
  flutter_pkg_cache:
    folder: bin/cache/pkg
49
    fingerprint_script: echo $OS; cat bin/internal/*.version
50
    reupload_on_changes: false
51 52
  artifacts_cache:
    folder: bin/cache/artifacts
53
    fingerprint_script: echo $OS; cat bin/internal/*.version
54
    reupload_on_changes: false
55 56
  setup_script:
    - date
57
    - git clean -xffd --exclude=bin/cache/
58 59 60
    - git fetch origin
    - git fetch origin master # To set FETCH_HEAD, so that "git merge-base" works.
    - flutter config --no-analytics
61
    - if [ "$SHOULD_UPDATE_PACKAGES" == TRUE ]; then flutter update-packages; fi
62 63 64 65 66 67 68
    - flutter doctor -v
    - ./dev/bots/accept_android_sdk_licenses.sh
    - date
  on_failure:
    failure_script:
      - date
      - which flutter
69
  matrix:
70 71 72 73 74 75 76 77 78
    - name: analyze-linux # linux-only
      only_if: "$CIRRUS_PR != ''"
      environment:
        # Empirically, the analyze-linux shard runs surprisingly fast (under 15 minutes) with just 1
        # CPU.  We noticed OOM failures with 6GB 4/2020, so we increased the memory.
        CPU: 1
        MEMORY: 8G
      script:
        - dart --enable-asserts ./dev/bots/analyze.dart
79

80
    - name: framework_tests-widgets-linux
81
      only_if: "changesInclude('.cirrus.yml', 'dev/**', 'packages/flutter/**', 'packages/flutter_test/**', 'packages/flutter_tools/lib/src/test/**', 'bin/**') && $CIRRUS_PR != ''"
82 83 84 85 86 87 88 89
      environment:
        # We use 3 CPUs because that's the minimum required to get framework_tests-widgets-linux
        # running fast enough that it is not the long pole, as of October 2019.
        CPU: 3
      script:
        - dart --enable-asserts ./dev/bots/test.dart

    - name: framework_tests-libraries-linux
90
      only_if: "changesInclude('.cirrus.yml', 'dev/**', 'packages/flutter/**', 'packages/flutter_test/**', 'packages/flutter_tools/lib/src/test/**', 'bin/**') && $CIRRUS_PR != ''"
91 92 93 94 95 96 97 98 99 100
      environment:
        # We use 3 CPUs because that's the minimum required to get the
        # framework_tests-libraries-linux shard running fast enough that it is not the long pole, as
        # of October 2019.
        CPU: 3
      script:
        - dart --enable-asserts ./dev/bots/test.dart

    - name: framework_tests-misc-linux
      # this includes the tests for directories in dev/
101
      only_if: "changesInclude('.cirrus.yml', 'dev/**', 'packages/flutter/**', 'packages/flutter_goldens/**', 'packages/flutter_test/**', 'packages/flutter_tools/lib/src/test/**', 'bin/**') && $CIRRUS_PR != ''"
102 103 104 105 106 107 108
      environment:
        # We use 3 CPUs because that's the minimum required to get framework_tests-misc-linux
        # running fast enough that it is not the long pole, as of October 2019.
        CPU: 3
      script:
        - dart --enable-asserts ./dev/bots/test.dart

109
    - name: tool_tests-general-linux
110
      only_if: "changesInclude('.cirrus.yml', 'dev/**', 'packages/flutter_tools/**', 'bin/**') && $CIRRUS_PR != ''"
111
      environment:
112 113
        # As of November 2019, the tool_tests-general-linux shard got faster with more CPUs up to 4
        # CPUs, and needed at least 10G of RAM to not run out of memory.
114
        CPU: 4
115
        MEMORY: 10G
116
        SHOULD_UPDATE_PACKAGES: "FALSE"
117
      script:
118 119 120 121
        - (cd packages/flutter_tools; dart __deprecated_pub get)
        - (cd packages/flutter_tools/test/data/asset_test/main; dart __deprecated_pub get)
        - (cd packages/flutter_tools/test/data/asset_test/font; dart __deprecated_pub get)
        - (cd dev/bots; dart __deprecated_pub get)
122 123 124
        - dart --enable-asserts ./dev/bots/test.dart

    - name: tool_tests-commands-linux
125
      only_if: "changesInclude('.cirrus.yml', 'dev/**', 'packages/flutter_tools/**', 'bin/**') && $CIRRUS_PR != ''"
126 127 128
      environment:
        # As of October 2019, the tool_tests-commands-linux shard got faster with more CPUs up to 6
        # CPUs, and needed at least 8G of RAM to not run out of memory.
129
        # Increased to 10GB on 19th Nov 2019 due to significant number of OOMKilled failures on PR builds.
130
        CPU: 6
131
        MEMORY: 10G
132
        SHOULD_UPDATE_PACKAGES: "FALSE"
133
      script:
134 135
        - (cd packages/flutter_tools; dart __deprecated_pub get)
        - (cd dev/bots; dart __deprecated_pub get)
136 137 138
        - dart --enable-asserts ./dev/bots/test.dart

    - name: docs-linux # linux-only
139
      environment:
140
        CPU: 4
141
        MEMORY: 12G
142
      only_if: "$CIRRUS_PR != ''"
143
      script:
144
        - ./dev/bots/docs.sh
145

146
    - name: customer_testing-linux
147
      only_if: "$CIRRUS_PR != ''"
148
      environment:
149 150
        # Empirically, this shard runs fine at 1 CPU and 4G RAM as of October 2019. We will probably
        # want to grow this container when we invite people to add their tests in large numbers.
151
        SHOULD_UPDATE_PACKAGES: "FALSE"
152
      script:
153 154 155 156 157 158
        # Cirrus doesn't give us the master branch, so we have to fetch it for ourselves,
        # otherwise we won't be able to figure out how old or new our current branch is.
        - git config user.email "cirrus-bot@invalid"
        - git fetch origin master:master
        # The actual logic is in a shell script so that it can be shared between CIs.
        - (cd dev/customer_testing/; ./ci.sh)
Dan Field's avatar
Dan Field committed
159

160
    - name: web_smoke_test
161
      only_if: "changesInclude('.cirrus.yml', 'examples/hello_world/**' ,'dev/**', 'packages/flutter/**', 'packages/flutter_test/**', 'packages/flutter_tools/lib/src/test/**', 'packages/flutter_web_plugins/**', 'bin/**') && $CIRRUS_PR != ''"
162 163 164 165 166 167 168 169 170
      environment:
        # Tests Hello World with Flutter Web Engine using Flutter Driver. Should not need more resources.
        CPU: 2
        MEMORY: 2G
        CHROME_NO_SANDBOX: true
      script:
        - flutter config --enable-web
        - git clone https://github.com/flutter/web_installers.git
        - cd web_installers/packages/web_drivers/
171
        - dart __deprecated_pub get
172
        - dart lib/web_driver_installer.dart chromedriver --install-only
173
        - chromedriver/chromedriver --port=4444 &
174
        - sleep 1
175 176
        - cd ../../../examples/hello_world/
        - flutter drive --target=test_driver/smoke_web_engine.dart -d web-server --profile --browser-name=chrome