Skip to content
Snippets Groups Projects
Commit fd940b2e authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Prepare the travis run to use a matrix of options

parent 03af3d68
No related branches found
No related tags found
1 merge request!5Prepare the travis run to use a matrix of options
......@@ -14,8 +14,8 @@ install:
- tar -xf cmake-3.7.1-Linux-x86_64.tar.gz
- export PATH="${PWD}/cmake-3.7.1-Linux-x86_64/bin:${PATH}"
- pip install --user flake8
env:
- BUILD_MATRIX_ENTRY=format
script:
- cd ${TRAVIS_BUILD_DIR}
- scripts/travis/run-clang-format.sh
- ~/.local/bin/flake8 --config=flake8.cfg .
- ${TRAVIS_BUILD_DIR}/scripts/travis/run.sh
#!/usr/bin/env bash
if [ -z "${TRAVIS_PULL_REQUEST_BRANCH}" ]
if [ -z "${SOURCE_DIR}" ]
then
echo "This is only designed to run on Pull Requests"
echo "Error: SOURCE_DIR is empty or undefined"
exit 1
else
COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../ }"
fi
if [ -z "${COMMIT_RANGE}" ]
then
echo "Error: COMMIT_RANGE is empty or undefined"
exit 1
fi
cd ${SOURCE_DIR}
# Run clang-format
DIFF="$(${TRAVIS_BUILD_DIR}/scripts/developer/git/git-clang-format --diff ${COMMIT_RANGE})"
# 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:"
......@@ -21,4 +26,10 @@ then
exit 1
fi
# Check python code with flake8
if ! ~/.local/bin/flake8 --config=flake8.cfg .
then
exit 3
fi
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