2019-04-19 20:20:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-05 00:18:57 +00:00
|
|
|
source util/travis_utils.sh
|
2019-10-14 16:57:53 +00:00
|
|
|
|
2019-11-05 00:18:57 +00:00
|
|
|
NUM_CORE_CHANGES=$(echo "$QMK_CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)' -e '^(util/)' -e '^(lib/python/)' -e '^(bin/qmk)' -e '^(requirements.txt)' -e '(.travis.yml)')
|
|
|
|
NUM_PY_CHANGES=$(echo "$QMK_CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)')
|
2019-04-19 20:20:02 +00:00
|
|
|
|
|
|
|
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then
|
|
|
|
echo "Skipping due to commit message"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-10-14 16:57:53 +00:00
|
|
|
exit_code=0
|
|
|
|
|
2019-11-05 00:18:57 +00:00
|
|
|
if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
|
2019-10-14 16:57:53 +00:00
|
|
|
echo "Running tests."
|
|
|
|
make test:all
|
|
|
|
: $((exit_code = $exit_code + $?))
|
|
|
|
|
2019-04-19 20:20:02 +00:00
|
|
|
fi
|
|
|
|
|
2019-11-05 00:18:57 +00:00
|
|
|
if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then
|
2019-10-14 16:57:53 +00:00
|
|
|
echo "Running python tests."
|
|
|
|
qmk pytest
|
|
|
|
: $((exit_code = $exit_code + $?))
|
2019-01-17 17:08:23 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-14 16:57:53 +00:00
|
|
|
exit $exit_code
|