This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
151 lines (135 loc) · 5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
sudo: false
os:
- osx
- linux
language: node_js
node_js: lts/*
env:
global:
- FLUTTER_TEST=true
matrix:
- ONLY_RUN_CODE_VERSION=STABLE ONLY_RUN_DART_VERSION=STABLE
- ONLY_RUN_CODE_VERSION=DEV ONLY_RUN_DART_VERSION=STABLE
- ONLY_RUN_CODE_VERSION=STABLE ONLY_RUN_DART_VERSION=DEV
- ONLY_RUN_CODE_VERSION=DEV ONLY_RUN_DART_VERSION=DEV
matrix:
fast_finish: true
allow_failures:
- env: ONLY_RUN_CODE_VERSION=DEV ONLY_RUN_DART_VERSION=STABLE
- env: ONLY_RUN_CODE_VERSION=STABLE ONLY_RUN_DART_VERSION=DEV
- env: ONLY_RUN_CODE_VERSION=DEV ONLY_RUN_DART_VERSION=DEV
# Don't build tags.
# Don't build Stable/Dev or Dev/Stable unless master (and not a PR->master merge build)
# as the changes of a failure showing up in those and not in either Stable/Stable or
# Dev/Dev are pretty slim so this will half the time for branch builds.
if: tag IS blank AND ((branch = master and type = push) OR (env(ONLY_RUN_DART_VERSION) = env(ONLY_RUN_CODE_VERSION)))
cache:
directories:
- $HOME/.pub-cache
- $HOME/.npm
- with\ spaces/flutter
addons:
chrome: stable
apt:
packages:
- libsecret-1-dev
- libstdc++6
- gcc-4.8
before_install:
- echo Misc setup
- export ELECTRON_NO_ATTACH_CONSOLE=1
- export TRAVIS_COMMIT_AUTHOR="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"
- gem install dpl
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.8" CC="gcc-4.8" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
export DART_OS=macos;
else
export DART_OS=linux;
fi
- echo Setting variables...
- if [[ $ONLY_RUN_DART_VERSION == "STABLE" ]]; then
export DART_CHANNEL=stable/release;
export FLUTTER_BRANCH=stable;
elif [[ $ONLY_RUN_DART_VERSION == "DEV" ]]; then
export DART_CHANNEL=dev/release;
export FLUTTER_BRANCH=dev;
else
export DART_CHANNEL=be/raw;
export FLUTTER_BRANCH=master;
fi
- mkdir -p with\ spaces
- cd with\ spaces
- echo Downloading Dart and Flutter...
- curl https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/latest/sdk/dartsdk-$DART_OS-x64-release.zip > dart-sdk.zip
- unzip dart-sdk.zip > /dev/null
- mkdir -p flutter
- cd flutter
- if [[ ! -d .git ]]; then
git init;
git remote add origin https://github.com/flutter/flutter.git;
else
git remote set-url origin https://github.com/flutter/flutter.git;
fi
- git fetch
- git reset --hard origin/$FLUTTER_BRANCH
- git checkout origin/$FLUTTER_BRANCH
- cd ..
- echo Configuring Dart and Flutter...
- flutter/bin/flutter config --no-analytics
- flutter/bin/flutter update-packages
- export FLUTTER_PATH=`pwd`/flutter
- export DART_PATH=`pwd`/dart-sdk
# To ensure we follow symlinks properly, put links
# in folders that we'll use in PATHs.
- mkdir dartsymlinkbins
- ln -s ../dart-sdk/bin/dart dartsymlinkbins/dart
- mkdir fluttersymlinkbins
- ln -s ../flutter/bin/flutter fluttersymlinkbins/flutter
# To ensure we detectonly detect real SDKs and not non-Dartlang
# dart binaries, add a fake dart that is actually just echo
- mkdir fakedart
- ln -s /bin/echo fakedart/dart
- export DART_PATH_SYMLINK=`pwd`/fakedart:`pwd`/dartsymlinkbins
- export FLUTTER_PATH_SYMLINK=`pwd`/fluttersymlinkbins
- dart-sdk/bin/dart --version
- flutter/bin/flutter --version
- dartsymlinkbins/dart --version
- fluttersymlinkbins/flutter --version
- node --version
- npm --version
- flutter/bin/flutter doctor
- dart-sdk/bin/pub global activate --no-executables stagehand
- dart-sdk/bin/pub global activate --no-executables args 1.5.0
- dart-sdk/bin/pub global activate --no-executables meta 1.1.6
- dart-sdk/bin/pub global activate --no-executables pedantic 1.4.0
- dart-sdk/bin/pub global activate --no-executables json_annotation 1.2.0
- dart-sdk/bin/pub global activate --no-executables devtools
- dart-sdk/bin/pub global activate --no-executables webdev
- cd ..
- mkdir -p .test_results
- mkdir -p .dart_code_test_logs
install:
- npm ci
before_script:
script:
- npm run vscode:prepublish
- npm run lint
- npm test
- killall flutter_tester || true
- ps -ax | grep -v grep | grep dart || true
- if [[ $(pgrep -x dart) ]]; then
echo 'DART WAS FOUND';
travis_result 1;
fi;
after_script:
- if [ $TRAVIS_PULL_REQUEST = "false" ]; then
dpl --provider=s3 --bucket="test-results.dartcode.org" --skip_cleanup=true --local-dir=".test_results" --upload-dir="$TRAVIS_BRANCH/$TRAVIS_COMMIT/$TRAVIS_OS_NAME" --acl=public_read --default_text_charset=utf-8;
dpl --provider=s3 --bucket="test-results.dartcode.org" --skip_cleanup=true --local-dir=".dart_code_test_logs" --upload-dir="logs/$TRAVIS_BRANCH/$TRAVIS_COMMIT/$TRAVIS_OS_NAME" --acl=public_read --default_text_charset=utf-8;
fi
- if [ $ONLY_RUN_CODE_VERSION == "STABLE" ] && [ $ONLY_RUN_DART_VERSION == "STABLE" ]; then
./cc-test-reporter after-build --prefix ../../ --exit-code $TRAVIS_TEST_RESULT;
fi