Rewrite travis.yml to build all the things
This commit is contained in:
parent
0cab0f114d
commit
baac5464a6
1 changed files with 9 additions and 16 deletions
25
.travis.yml
25
.travis.yml
|
@ -27,12 +27,6 @@ before_script:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
changes_in() {
|
|
||||||
[[ $(git diff --name-only $(git merge-base master $TRAVIS_COMMIT)..$TRAVIS_COMMIT | \
|
|
||||||
cut -d "/" -f 1 | \
|
|
||||||
grep "$n") ]] > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
travis_cargo_run_in() {
|
travis_cargo_run_in() {
|
||||||
echo ":: Trying to run cargo in $1"
|
echo ":: Trying to run cargo in $1"
|
||||||
[[ -d "$1" ]] &&
|
[[ -d "$1" ]] &&
|
||||||
|
@ -47,26 +41,25 @@ script:
|
||||||
}
|
}
|
||||||
|
|
||||||
run_sh_test() {
|
run_sh_test() {
|
||||||
echo "-- Running test script: $1"
|
echo "--- Running test script: $1"
|
||||||
bash $1 || { echo "-- Test failed. Exiting"; exit 1; }
|
bash $1 || { echo "--- Test failed. Exiting"; exit 1; }
|
||||||
echo "-- Test script $1 executed successfully"
|
echo "--- Test script $1 executed successfully"
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ $(changes_in "doc") ]] && echo "Changes in ./doc are not build by CI"
|
echo "<< Changes in ./doc are not build by CI >>"
|
||||||
|
|
||||||
for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
|
for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
|
||||||
echo ":: Working on $d"
|
echo ":: Working on $d"
|
||||||
dir=$(dirname $d)
|
dir=$(dirname $d)
|
||||||
{ \
|
{ \
|
||||||
changes_in $dir && \
|
echo -e "\n--- Running in $d ---\n" && \
|
||||||
echo -e "\nRunning in $d\n" && \
|
travis_cargo_run_in $dir && \
|
||||||
travis_cargo_run_in $dir && \
|
tree -I "*doc*" $dir && \
|
||||||
tree -I "*doc*" $dir && \
|
echo "--- Running test scripts ---" && \
|
||||||
echo "-- Running test scripts..." && \
|
|
||||||
for testsh in $(find $dir -iname "*test.sh"); do
|
for testsh in $(find $dir -iname "*test.sh"); do
|
||||||
run_sh_test $testsh
|
run_sh_test $testsh
|
||||||
done && \
|
done && \
|
||||||
echo "-- Done with test scripts..."
|
echo -e "--- Done with test scripts ---\n\n"
|
||||||
} || true
|
} || true
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue