-
-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathci
executable file
·35 lines (34 loc) · 903 Bytes
/
ci
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
#!/usr/bin/env bash
##################################################################
##
## Test case for CI building
##
##
## Author: Chaobin Wu
## Email : chaobinwu89@gmail.com
##
#################################################################
tag='[CI]'
error() {
echo -e "\033[1m$tag\033[0m \033[31m$*\033[0m"
}
info() {
echo -e "\033[1m$tag\033[0m \033[32m$*\033[0m"
}
warning() {
echo -e "\033[1m$tag\033[0m \033[33m$*\033[0m"
}
die() {
error "$*"
exit 1
}
info "Step 1 Run custom lint rules"
dart analyze lib ci-analysis_options.yaml >build/lint-result.txt
# n lints found. => issue found, No issues found! => success
count=$(grep -c 'lints found.' <build/lint-result.txt)
if [ "$count" = "0" ]; then
info "Lint check passed."
else
warning "Issues list:\n$(grep 'lint' <build/lint-result.txt)"
die "Failed to pass Lint rules, check lint result at build/lint-result.txt"
fi