Skip to content
Snippets Groups Projects
Commit 2ff88538 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon Committed by GitHub
Browse files

Merge pull request #5 from chuckatkins/add-travis-matrix

Prepare the travis run to use a matrix of options
parents 03af3d68 fd940b2e
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,8 @@ install: ...@@ -14,8 +14,8 @@ install:
- tar -xf cmake-3.7.1-Linux-x86_64.tar.gz - tar -xf cmake-3.7.1-Linux-x86_64.tar.gz
- export PATH="${PWD}/cmake-3.7.1-Linux-x86_64/bin:${PATH}" - export PATH="${PWD}/cmake-3.7.1-Linux-x86_64/bin:${PATH}"
- pip install --user flake8 - pip install --user flake8
env:
- BUILD_MATRIX_ENTRY=format
script: script:
- cd ${TRAVIS_BUILD_DIR} - ${TRAVIS_BUILD_DIR}/scripts/travis/run.sh
- scripts/travis/run-clang-format.sh
- ~/.local/bin/flake8 --config=flake8.cfg .
#!/usr/bin/env bash #!/usr/bin/env bash
if [ -z "${TRAVIS_PULL_REQUEST_BRANCH}" ] if [ -z "${SOURCE_DIR}" ]
then then
echo "This is only designed to run on Pull Requests" echo "Error: SOURCE_DIR is empty or undefined"
exit 1 exit 1
else
COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../ }"
fi fi
if [ -z "${COMMIT_RANGE}" ]
then
echo "Error: COMMIT_RANGE is empty or undefined"
exit 1
fi
cd ${SOURCE_DIR}
# Run clang-format # Check C and C++ code with clang-format
DIFF="$(${TRAVIS_BUILD_DIR}/scripts/developer/git/git-clang-format --diff ${COMMIT_RANGE})" DIFF="$(./scripts/developer/git/git-clang-format --diff ${COMMIT_RANGE})"
if [ "${DIFF}" != "no modified files to format" ] if [ "${DIFF}" != "no modified files to format" ]
then then
echo "clang-format:" echo "clang-format:"
...@@ -21,4 +26,10 @@ then ...@@ -21,4 +26,10 @@ then
exit 1 exit 1
fi fi
# Check python code with flake8
if ! ~/.local/bin/flake8 --config=flake8.cfg .
then
exit 3
fi
exit 0 exit 0
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment