From e429f14d4af279c9e0f916e7f179a750002339a4 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 11:42:55 -0700 Subject: [PATCH 01/12] Switch to building on ubuntu 20.04 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 895e64d5..6b8b843d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: focal sudo: false language: c os: From e26e19b7886d4d92d9ac5e4043cee7aa71825008 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 11:45:03 -0700 Subject: [PATCH 02/12] switch to quiet git clones --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6b8b843d..b1e475d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ addons: env: global: - LC_ALL: C +git: + quiet: true install: - git clone --depth 1 --recurse-submodules https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio ## We delete the Bundle's version of Kaleidoscope, and symlink ourselves in. From e72cd8b7b005034965f0911029b063d379c06516 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 12:06:00 -0700 Subject: [PATCH 03/12] Stop caching a directory we explictly delete. report some ccache stats for debugging --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1e475d0..c785991f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,12 +21,7 @@ install: - ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope script: - unset CC - - make cpplint BOARD_HARDWARE_PATH=$(pwd)/../hardware - - make travis-install-arduino BOARD_HARDWARE_PATH=$(pwd)/../hardware - - (cd ../hardware/keyboardio && make prepare-virtual) - - make -C tests all BOARD_HARDWARE_PATH=$(pwd)/../hardware ARDUINO_PATH="$(pwd)/arduino-1.8.13" - - rm -rf .kaleidoscope-build-cache - - make travis-test KALEIDOSCOPE_TEMP_PATH=$(pwd)/.kaleidoscope-build-cache BOARD_HARDWARE_PATH=$(pwd)/../hardware + - make $TEST_TARGET KALEIDOSCOPE_TEMP_PATH=$(pwd)/.kaleidoscope-build-cache BOARD_HARDWARE_PATH=$(pwd)/../hardware ARDUINO_PATH="$(pwd)/arduino-1.8.13" notifications: email: on_success: change @@ -34,5 +29,4 @@ notifications: cache: ccache: true directories: - - .kaleidoscope-build-cache - .ccache From b9bca2cf7fd4d2aa6a6f3f5d3ab8896a42b6ef5c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 12:18:21 -0700 Subject: [PATCH 04/12] remove a bit of unused info from the compilation step reporting --- bin/kaleidoscope-builder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 4028db27..294fd65f 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -345,7 +345,7 @@ compile () { SKETCH_DIR="$(find_sketch)" - echo "Building ${SKETCH_DIR}/${SKETCH} ${LIB_VERSION} into ${OUTPUT_PATH}" + echo "Building ${SKETCH_DIR}/${SKETCH}" # This is defined in the (optional) user config. # shellcheck disable=SC2154 From f56ea0d5e4d167852369d104e41bd997ce29422c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 13:57:33 -0700 Subject: [PATCH 05/12] Try to make our ccache hit rate better using more flexible matching heuristics --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c785991f..9531375f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ env: - LC_ALL: C git: quiet: true +before-install: + - ccache --set-config=compiler_check=content install: - git clone --depth 1 --recurse-submodules https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio ## We delete the Bundle's version of Kaleidoscope, and symlink ourselves in. From 1da4882fd2e17f5692d43d8ec9db05338e9ef527 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 14:47:15 -0700 Subject: [PATCH 06/12] open up our ccache a bit, try to cache apt pkgs --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9531375f..93c3742e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,8 @@ env: git: quiet: true before-install: - - ccache --set-config=compiler_check=content + - ccache --set-config=compiler_check=content -M 5G -F 0 + install: - git clone --depth 1 --recurse-submodules https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio ## We delete the Bundle's version of Kaleidoscope, and symlink ourselves in. @@ -29,6 +30,7 @@ notifications: on_success: change on_failure: change cache: + apt: true ccache: true directories: - .ccache From 5af5d6a027ad55ced61e66428d55c800c57806b5 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 15:13:45 -0700 Subject: [PATCH 07/12] Try to cache our arduino download --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 93c3742e..d80ba5b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,3 +34,4 @@ cache: ccache: true directories: - .ccache + - .download-cache From ff2005bdb221a5a889408f4cf348986a53226bbe Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 15:49:40 -0700 Subject: [PATCH 08/12] try explicitly caching the build cache --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d80ba5b0..eb6a94a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,3 +35,4 @@ cache: directories: - .ccache - .download-cache + - .kaleidoscope-build-cache From cb9cc68119df34df3f67c5d6c51d5b44031c419c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 21:51:23 -0700 Subject: [PATCH 09/12] we don't need to double-cache ccache --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb6a94a7..31843025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,5 @@ cache: apt: true ccache: true directories: - - .ccache - .download-cache - .kaleidoscope-build-cache From 2b209a1fe5cbfcab767cb4d9736e3b4821600bf7 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 15:55:20 -0700 Subject: [PATCH 10/12] Break out our tests into a build matrix for parallelization and readability --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 31843025..d3dc9893 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,14 @@ install: ## This makes sure we're using the current version of the library. - rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope - ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope +jobs: + include: + - env: TEST_TARGET=travis-smoke-examples + - env: TEST_TARGET=travis-simulator-tests + - env: TEST_TARGET=cpplint + - env: TEST_TARGET=find-filename-conflicts + - env: TEST_TARGET=shellcheck + - env: TEST_TARGET=travis-check-astyle script: - unset CC - make $TEST_TARGET KALEIDOSCOPE_TEMP_PATH=$(pwd)/.kaleidoscope-build-cache BOARD_HARDWARE_PATH=$(pwd)/../hardware ARDUINO_PATH="$(pwd)/arduino-1.8.13" From 8150eec669c75c14e5c99c28b31410cb20e1ad69 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 19:57:58 -0700 Subject: [PATCH 11/12] Switch from naming our cache directories based on inode to naming them based on the absolute path, so we don't blow the cache 100% of the time on travis --- bin/kaleidoscope-builder | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 294fd65f..997bad61 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -19,6 +19,12 @@ set -e ###### Build and output configuration ###### +absolute_filename() { + echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +} + + + build_version () { GIT_VERSION="$(cd "$(find_sketch)"; if [ -d .git ]; then echo -n '-g' && git describe --abbrev=4 --dirty --always; fi)" LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}" @@ -26,9 +32,9 @@ build_version () { } build_paths() { - # We don't really want to use find - # shellcheck disable=SC2012 - SKETCH_IDENTIFIER="$(ls -id "$(find_sketch)/${SKETCH}.ino" | cut -d ' ' -f 1)-${SKETCH}.ino" + # We need that echo because we\re piping to cksum + # shellcheck disable=SC2005 + SKETCH_IDENTIFIER="$(echo "$(absolute_filename "$(find_sketch)/${SKETCH}.ino")" | cksum | cut -d ' ' -f 1)-${SKETCH}.ino" KALEIDOSCOPE_TEMP_PATH="${KALEIDOSCOPE_TEMP_PATH:-${TMPDIR:-/tmp}/kaleidoscope-${USER}}" From 9aff83fb6528e95fb193e75d19fab3b42f568e75 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 22:49:16 -0700 Subject: [PATCH 12/12] Fixed travis config issues reeported by travis --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3dc9893..ef88cc67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ dist: focal -sudo: false language: c os: - linux @@ -13,7 +12,7 @@ env: - LC_ALL: C git: quiet: true -before-install: +before_install: - ccache --set-config=compiler_check=content -M 5G -F 0 install: