Skip to content

Commit 099bdce

Browse files
authored
Merge pull request #9 from kevmoo/travis_fixes
Travis fixes
2 parents 80b60aa + 6771f1e commit 099bdce

File tree

3 files changed

+48
-42
lines changed

3 files changed

+48
-42
lines changed

.travis.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v1.2.1
1+
# Created with package:mono_repo v2.1.0
22
language: dart
33

44
# Custom configuration
@@ -8,20 +8,20 @@ branches:
88
jobs:
99
include:
1010
- stage: analyze
11-
name: "SDK: stable - DIR: retry - TASKS: dartanalyzer ."
12-
script: ./tool/travis.sh dartanalyzer
13-
env: PKG="retry"
11+
name: "SDK: stable; PKGS: canonical_json, chunked_stream, http_methods, neat_periodic_task, pem, retry, sanitize_html, shelf_router, shelf_router_generator, slugid; TASKS: `dartanalyzer .`"
1412
dart: stable
13+
env: PKGS="canonical_json chunked_stream http_methods neat_periodic_task pem retry sanitize_html shelf_router shelf_router_generator slugid"
14+
script: ./tool/travis.sh dartanalyzer
1515
- stage: analyze
16-
name: "SDK: stable - DIR: retry - TASKS: dartfmt -n --set-exit-if-changed ."
17-
script: ./tool/travis.sh dartfmt
18-
env: PKG="retry"
16+
name: "SDK: stable; PKGS: canonical_json, chunked_stream, http_methods, neat_periodic_task, pem, retry, sanitize_html, shelf_router, shelf_router_generator, slugid; TASKS: `dartfmt -n --set-exit-if-changed .`"
1917
dart: stable
18+
env: PKGS="canonical_json chunked_stream http_methods neat_periodic_task pem retry sanitize_html shelf_router shelf_router_generator slugid"
19+
script: ./tool/travis.sh dartfmt
2020
- stage: unit_test
21-
name: "SDK: stable - DIR: retry - TASKS: pub run test"
22-
script: ./tool/travis.sh test
23-
env: PKG="retry"
21+
name: "SDK: stable; PKGS: canonical_json, chunked_stream, http_methods, neat_periodic_task, pem, retry, sanitize_html, shelf_router, shelf_router_generator, slugid; TASKS: `pub run test`"
2422
dart: stable
23+
env: PKGS="canonical_json chunked_stream http_methods neat_periodic_task pem retry sanitize_html shelf_router shelf_router_generator slugid"
24+
script: ./tool/travis.sh test
2525

2626
stages:
2727
- analyze

mono_repo.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# See with https://pub.dev/packages/mono_repo for details on this file
2+
13
travis:
24
branches:
3-
exclude: []
5+
exclude: []
6+
7+
merge_stages: [analyze, unit_test]

tool/travis.sh

+33-31
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
#!/bin/bash
2-
# Created with package:mono_repo v1.2.1
2+
# Created with package:mono_repo v2.1.0
33

4-
if [ -z "$PKG" ]; then
5-
echo -e '\033[31mPKG environment variable must be set!\033[0m'
4+
if [[ -z ${PKGS} ]]; then
5+
echo -e '\033[31mPKGS environment variable must be set!\033[0m'
66
exit 1
77
fi
88

9-
if [ "$#" == "0" ]; then
9+
if [[ "$#" == "0" ]]; then
1010
echo -e '\033[31mAt least one task argument must be provided!\033[0m'
1111
exit 1
1212
fi
1313

14-
pushd $PKG
15-
pub upgrade || exit $?
16-
1714
EXIT_CODE=0
1815

19-
while (( "$#" )); do
20-
TASK=$1
21-
case $TASK in
22-
dartanalyzer) echo
23-
echo -e '\033[1mTASK: dartanalyzer\033[22m'
24-
echo -e 'dartanalyzer .'
25-
dartanalyzer . || EXIT_CODE=$?
26-
;;
27-
dartfmt) echo
28-
echo -e '\033[1mTASK: dartfmt\033[22m'
29-
echo -e 'dartfmt -n --set-exit-if-changed .'
30-
dartfmt -n --set-exit-if-changed . || EXIT_CODE=$?
31-
;;
32-
test) echo
33-
echo -e '\033[1mTASK: test\033[22m'
34-
echo -e 'pub run test'
35-
pub run test || EXIT_CODE=$?
36-
;;
37-
*) echo -e "\033[31mNot expecting TASK '${TASK}'. Error!\033[0m"
38-
EXIT_CODE=1
39-
;;
40-
esac
16+
for PKG in ${PKGS}; do
17+
echo -e "\033[1mPKG: ${PKG}\033[22m"
18+
pushd "${PKG}" || exit $?
19+
pub upgrade --no-precompile || exit $?
20+
21+
for TASK in "$@"; do
22+
echo
23+
echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m"
24+
case ${TASK} in
25+
dartanalyzer)
26+
echo 'dartanalyzer .'
27+
dartanalyzer . || EXIT_CODE=$?
28+
;;
29+
dartfmt)
30+
echo 'dartfmt -n --set-exit-if-changed .'
31+
dartfmt -n --set-exit-if-changed . || EXIT_CODE=$?
32+
;;
33+
test)
34+
echo 'pub run test'
35+
pub run test || EXIT_CODE=$?
36+
;;
37+
*)
38+
echo -e "\033[31mNot expecting TASK '${TASK}'. Error!\033[0m"
39+
EXIT_CODE=1
40+
;;
41+
esac
42+
done
4143

42-
shift
44+
popd
4345
done
4446

45-
exit $EXIT_CODE
47+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)