This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtravis_script.sh
71 lines (53 loc) · 1.67 KB
/
travis_script.sh
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
set -e
# Backs up one directory at a time, looking for one called "flutter".
function getFlutterPath() {
local path=".."
local counter=0
while [[ "${counter}" -lt 10 ]]; do
[ -d "${path}/flutter" ] && echo "${path}/flutter" && return 0
let counter++
path="${path}/.."
done
}
declare -a PROJECT_NAMES=(
"gallery" \
)
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
do
echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel =="
pushd "${PROJECT_NAME}"
localSdkPath=$(getFlutterPath)
if [ -z "$localSdkPath" ]
then
echo "Failed to find Flutter SDK for '${PROJECT_NAME}'."
exit 1
fi
# Run the analyzer to find any static analysis issues.
"${localSdkPath}/bin/flutter" analyze
# Run the formatter on all the dart files to make sure everything's linted.
"${localSdkPath}/bin/flutter" format -n --set-exit-if-changed .
# Run the actual tests.
"${localSdkPath}/bin/flutter" test
popd
done
declare -a CLI_PROJECT_NAMES=(
"codeviewer_cli" \
"l10n_cli" \
)
for PROJECT_NAME in "${CLI_PROJECT_NAMES[@]}"
do
echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel =="
pushd "${PROJECT_NAME}"
localSdkPath=$(getFlutterPath)
if [ -z "$localSdkPath" ]
then
echo "Failed to find Flutter SDK for '${PROJECT_NAME}'."
exit 1
fi
# Run the analyzer to find any static analysis issues.
"${localSdkPath}/bin/flutter" analyze
# Run the formatter on all the dart files to make sure everything's linted.
"${localSdkPath}/bin/flutter" format -n --set-exit-if-changed .
popd
done
echo "-- Success --"