Skip to content

Commit 6428a3f

Browse files
authored
Improved build time by avoiding 'brew update', caching, and using pre-compiled flutter (brianegan#103)
* Skipped 'brew update' * Installed pre-compiled flutter for mac and linux * Added caching of .pub-cache and .gradle * Removed old dependency_overrides
1 parent a5d8758 commit 6428a3f

File tree

4 files changed

+43
-20
lines changed

4 files changed

+43
-20
lines changed

.travis.yml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ jobs:
77
env: All unit and widget tests
88
before_script:
99
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
10-
- git clone https://github.com/flutter/flutter.git -b stable
10+
11+
# - git clone https://github.com/flutter/flutter.git -b stable
12+
# - flutter precache
13+
14+
# install pre-compiled flutter
15+
- FLUTTER_CHANNEL=stable
16+
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
17+
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
1118
- export PATH="$PATH":"$HOME/.pub-cache/bin"
12-
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
13-
- flutter precache
19+
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
1420
- flutter doctor -v
1521
- pub global activate coverage
1622
script: ./scripts/runTests.sh
1723
after_success: bash <(curl -s https://codecov.io/bash) -f lcov.info
24+
cache:
25+
directories:
26+
- $HOME/.pub-cache
1827

1928
- &integration-test-staging
2029
stage: Integration Testing
@@ -51,17 +60,28 @@ jobs:
5160
- sdkmanager --list | head -15
5261
- echo no | avdmanager create avd --force -n test -k "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI"
5362
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window -gpu swiftshader &
54-
# install flutter
55-
- git clone https://github.com/flutter/flutter.git -b stable
63+
64+
# - git clone https://github.com/flutter/flutter.git -b stable
65+
# - flutter precache
66+
67+
# install pre-compiled flutter
68+
- FLUTTER_CHANNEL=stable
69+
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
70+
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
5671
- export PATH="$PATH":"$HOME/.pub-cache/bin"
57-
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
58-
- flutter precache
72+
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
5973
- flutter doctor -v
74+
6075
# Wait for emulator to finish startup.
6176
- ./scripts/android-wait-for-emulator.sh
6277
- adb shell input keyevent 82
6378
- flutter devices
6479
script: travis_retry ./scripts/ci.sh ./example/bloc_flutter
80+
cache:
81+
directories:
82+
- $HOME/.pub-cache
83+
- $HOME/.gradle
84+
6585
- <<: *integration-test-staging
6686
os: osx
6787
# use oldest flutter supported version of xcode
@@ -70,19 +90,31 @@ jobs:
7090
# Run integration tests on ios
7191
before_install: &before_install_osx
7292
- open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
73-
- brew update
93+
# skip homebrew update
94+
- export HOMEBREW_NO_AUTO_UPDATE=1
95+
# - brew update
7496
- brew install libimobiledevice
7597
- brew install ideviceinstaller
7698
- brew install ios-deploy
7799
- brew install cocoapods || echo 'ignore exit(1)'
78100
- brew link --overwrite cocoapods
79-
- git clone https://github.com/flutter/flutter.git -b stable
101+
102+
# - git clone https://github.com/flutter/flutter.git -b stable
103+
# - flutter precache
104+
105+
# install pre-compiled flutter
106+
- FLUTTER_CHANNEL=stable
107+
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
108+
- wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/macos/flutter_macos_v${FLUTTER_VERSION}.zip && unzip -qq flutter.zip > /dev/null && rm flutter.zip
80109
- export PATH="$PATH":"$HOME/.pub-cache/bin"
81-
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
82-
- flutter precache
110+
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
83111
- flutter doctor -v
84112
- flutter devices
85113
script: travis_retry ./scripts/ci.sh ./example/bloc_flutter
114+
cache:
115+
directories:
116+
- $HOME/.pub-cache
117+
86118
- <<: *integration-test-staging
87119
os: linux
88120
env: built_redux_android

example/built_redux/pubspec.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ dev_dependencies:
2828
integration_tests:
2929
path: ../integration_tests
3030

31-
dependency_overrides:
32-
analyzer: ^0.34.1
33-
3431
# For information on the generic Dart part of this file, see the
3532
# following page: https://www.dartlang.org/tools/pub/pubspec
3633

example/mvu/pubspec.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ dev_dependencies:
3030
path: ../integration_tests
3131
test: ^1.5.1
3232

33-
dependency_overrides:
34-
analyzer: ^0.33.0
35-
3633
# For information on the generic Dart part of this file, see the
3734
# following page: https://www.dartlang.org/tools/pub/pubspec
3835

example/redurx/pubspec.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,5 @@ dev_dependencies:
2929
integration_tests:
3030
path: ../integration_tests
3131

32-
dependency_overrides:
33-
analyzer: ^0.33.0
34-
3532
flutter:
3633
uses-material-design: true

0 commit comments

Comments
 (0)