-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from chuckatkins/add-travis-matrix
Prepare the travis run to use a matrix of options
- Loading branch information
Showing
4 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "${SOURCE_DIR}" ] | ||
then | ||
echo "Error: SOURCE_DIR is empty or undefined" | ||
exit 1 | ||
fi | ||
if [ -z "${COMMIT_RANGE}" ] | ||
then | ||
echo "Error: COMMIT_RANGE is empty or undefined" | ||
exit 1 | ||
fi | ||
|
||
cd ${SOURCE_DIR} | ||
|
||
# Check C and C++ code with clang-format | ||
DIFF="$(./scripts/developer/git/git-clang-format --diff ${COMMIT_RANGE})" | ||
if [ "${DIFF}" != "no modified files to format" ] | ||
then | ||
echo "clang-format:" | ||
echo " Code format checks failed." | ||
echo " Please run clang-format (or git clang-format) on your changes" | ||
echo " before committing." | ||
echo " The following changes are suggested:" | ||
echo "${DIFF}" | ||
exit 1 | ||
fi | ||
|
||
# Check python code with flake8 | ||
if ! ~/.local/bin/flake8 --config=flake8.cfg . | ||
then | ||
exit 3 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
export SOURCE_DIR=${TRAVIS_BUILD_DIR} | ||
export BUILD_DIR=$(readlink -f ${SOURCE_DIR}/..) | ||
export COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../ }" | ||
|
||
case ${BUILD_MATRIX_ENTRY} in | ||
format) | ||
echo "Running formatting tests" | ||
if ! ${SOURCE_DIR}/scripts/travis/run-format.sh; then | ||
exit 1; | ||
fi | ||
;; | ||
*) | ||
echo "Error: BUILD_MATRIX_ENTRY is undefined or set to an unknown value" | ||
exit 1; | ||
;; | ||
esac |