summaryrefslogtreecommitdiff
path: root/util/travis_test.sh
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-11-05 00:18:57 +0000
committerDrashna Jaelre <drashna@live.com>2019-11-04 16:18:57 -0800
commitd382eeeb9d3b795c16533c5f64ab1455e774f925 (patch)
tree9fa7bef8d19813fce3b8f7d60ebbfd3e87dd7393 /util/travis_test.sh
parentefa28d0f5cca55b0dfecaddd0860ec3dfeab8bb0 (diff)
CI - Fix change detection (#7038)
* Fix travis change detection * Fix travis change detection - add back python ignore
Diffstat (limited to 'util/travis_test.sh')
-rw-r--r--util/travis_test.sh27
1 files changed, 5 insertions, 22 deletions
diff --git a/util/travis_test.sh b/util/travis_test.sh
index 9b7402c282..95991907ef 100644
--- a/util/travis_test.sh
+++ b/util/travis_test.sh
@@ -1,26 +1,9 @@
#!/bin/bash
-# if docker is installed - patch calls to within the qmk docker image
-if command -v docker >/dev/null; then
- function make() {
- docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
- }
- function qmk() {
- docker run --rm -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container bin/qmk "$@"
- }
-fi
-
-TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
-TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
-
-# test force push
-#TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d"
-
-BRANCH=$(git rev-parse --abbrev-ref HEAD)
-CHANGES=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE})
+source util/travis_utils.sh
-NUM_CORE_CHANGES=$(echo "$CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)')
-NUM_PY_CHANGES=$(echo "$CHANGES" | grep -Ec -e '^(lib/python/)' -e '^(bin/qmk)')
+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)')
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then
echo "Skipping due to commit message"
@@ -29,14 +12,14 @@ fi
exit_code=0
-if [ "$BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
+if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_CORE_CHANGES" != "0" ]; then
echo "Running tests."
make test:all
: $((exit_code = $exit_code + $?))
fi
-if [ "$BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then
+if [ "$LOCAL_BRANCH" == "master" ] || [ "$NUM_PY_CHANGES" != "0" ]; then
echo "Running python tests."
qmk pytest
: $((exit_code = $exit_code + $?))