forked from flutter/codelabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flutter_ci_script_stable.sh
executable file
·57 lines (48 loc) · 1.25 KB
/
flutter_ci_script_stable.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
#!/usr/bin/env bash
set -e -o pipefail
if [[ -n "$(type -t flutter)" ]]; then
: ${FLUTTER:=flutter}
fi
echo "== FLUTTER: $FLUTTER"
FLUTTER_VERS=`$FLUTTER --version | head -1`
echo "== FLUTTER_VERS: $FLUTTER_VERS"
# plugin_codelab is a special case since it's a plugin. Analysis doesn't seem to be working.
pushd $PWD
echo "== TESTING plugin_codelab"
cd ./plugin_codelab
$FLUTTER format --dry-run --set-exit-if-changed .;
popd
declare -a CODELABS=(
"add_flutter_to_android_app"
"cookbook"
"cupertino_store"
"firebase-get-to-know-flutter"
"friendly_chat"
"github-graphql-client"
"google-maps-in-flutter"
"startup_namer"
"star_counter"
"startup_namer_null_safety"
"testing_codelab"
)
# Plugin codelab is failing on ubuntu-latest in CI.
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
CODELABS+=("plugin_codelab")
fi
declare -a PROJECT_PATHS=($(
for CODELAB in "${CODELABS[@]}"
do
find $CODELAB -not -path './flutter/*' -not -path './plugin_codelab/pubspec.yaml' -name pubspec.yaml -exec dirname {} \;
done
))
for PROJECT in "${PROJECT_PATHS[@]}"; do
echo "== TESTING $PROJECT"
(
cd "$PROJECT";
set -x;
$FLUTTER analyze;
$FLUTTER format --dry-run --set-exit-if-changed .;
$FLUTTER test
)
done
echo "== END OF TESTS"