Skip to content

Commit f1c997f

Browse files
authored
Check the return of the single CI tests (#312)
1 parent c7d06c2 commit f1c997f

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

scripts/ci.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#! /bin/bash
22

3+
check_for_failure() {
4+
"$@" || failure=1
5+
}
6+
37
location="$(cd "$(dirname "${0}")";pwd -P)"
48
root="$(cd "$(dirname "${location}/../..")";pwd -P)"
59

610
echo "Check format"
7-
"${root}"/scripts/check-format.sh
11+
check_for_failure "${root}"/scripts/check-format.sh
812
echo "-------------------------------------------------------------------------"
913

1014
echo "Check docstring style"
11-
pydocstyle
15+
check_for_failure pydocstyle
1216
echo "-------------------------------------------------------------------------"
1317

1418
echo "Check typing with mypy"
15-
python3 -m mypy --config-file mypy.ini pedpy/
19+
check_for_failure python3 -m mypy --config-file mypy.ini pedpy/
1620
echo "-------------------------------------------------------------------------"
1721

1822
echo "Linting with pylint"
19-
python3 -m pylint --recursive=y --extension-pkg-whitelist=scipy pedpy pedpy/data pedpy/io pedpy/methods pedpy/plotting pedpy/internal
23+
check_for_failure python3 -m pylint --recursive=y --extension-pkg-whitelist=scipy pedpy pedpy/data pedpy/io pedpy/methods pedpy/plotting pedpy/internal
24+
echo "-------------------------------------------------------------------------"
2025

26+
if ((failure)); then
27+
echo "Automated tests failed" >&2
28+
exit 1
29+
else
30+
echo "Automated tests succeeded" >&2
31+
exit 0
32+
fi

0 commit comments

Comments
 (0)