travis: Use makefile for building things
This commit is contained in:
parent
9f1faf764f
commit
797ea9e852
1 changed files with 13 additions and 33 deletions
44
.travis.yml
44
.travis.yml
|
@ -20,49 +20,29 @@ before_script:
|
||||||
export PATH=$HOME/.local/bin:$PATH
|
export PATH=$HOME/.local/bin:$PATH
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
travis_cargo_run_in() {
|
libs_to_test="$(find . -maxdepth 1 name "libimag*" -printf "test-%f ")"
|
||||||
echo ":: Trying to run cargo in $1"
|
bins_to_build="$(find . -maxdepth 1 name "imag-*" -printf "%f ")"
|
||||||
[[ -d "$1" ]] &&
|
make $libs_to_test && \
|
||||||
cd "$1" &&
|
make $bins_to_build && \
|
||||||
{
|
for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
|
||||||
{
|
dir=$(dirname $d)
|
||||||
if [[ $(echo "$1" | grep lib) ]]; then
|
{ \
|
||||||
travis-cargo -q test
|
echo "--- Running test scripts ---" && \
|
||||||
else
|
for testsh in $(find $dir -iname "*test.sh"); do
|
||||||
travis-cargo -q build
|
|
||||||
fi
|
|
||||||
} &&
|
|
||||||
cd -
|
|
||||||
} || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
||||||
}
|
|
||||||
|
|
||||||
echo "<< Changes in ./doc are not build by CI >>"
|
|
||||||
|
|
||||||
for d in $(find -name "Cargo.toml" | grep -vE "^./Cargo.toml$"); do
|
|
||||||
echo ":: Working on $d"
|
|
||||||
dir=$(dirname $d)
|
|
||||||
{ \
|
|
||||||
echo -e "\n--- Running in $d ---\n" && \
|
|
||||||
travis_cargo_run_in $dir && \
|
|
||||||
echo "--- Running test scripts ---" && \
|
|
||||||
for testsh in $(find $dir -iname "*test.sh"); do
|
|
||||||
run_sh_test $testsh
|
|
||||||
done && \
|
done && \
|
||||||
echo -e "--- Done with test scripts ---\n\n"
|
|
||||||
} || true
|
} || true
|
||||||
done
|
done
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- libcurl4-openssl-dev
|
- libcurl4-openssl-dev
|
||||||
- libelf-dev
|
|
||||||
- libdw-dev
|
- libdw-dev
|
||||||
|
- libelf-dev
|
||||||
|
- make
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
pushd .imag-documentation &&
|
pushd .imag-documentation &&
|
||||||
|
|
Loading…
Reference in a new issue