Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 0edcaca

Browse files
committed
Added cache support for 'travis' builds.
Also refactored config to make it a bit cleaner.
1 parent 7710a8e commit 0edcaca

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.travis.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
if: branch != feature/appveyor-ci
12
language: cpp
23
os:
34
- linux
45
- osx
56
env:
6-
- ARDUINO_SDK_VERSION=1.6.10
7-
- ARDUINO_SDK_VERSION=1.8.7
8-
if: branch != feature/appveyor-ci
7+
global:
8+
- ARDUINO_SDK_BASE_PATH=/home/travis/arduino-sdk/arduino
9+
matrix:
10+
- ARDUINO_SDK_VERSION=1.6.10
11+
- ARDUINO_SDK_VERSION=1.8.7
12+
cache:
13+
directories:
14+
- $ARDUINO_SDK_BASE_PATH-$ARDUINO_SDK_VERSION
915
addons:
1016
apt:
1117
packages:
@@ -14,23 +20,25 @@ addons:
1420
- avrdude
1521
- cmake
1622
before_install:
23+
- sdk_path="$ARDUINO_SDK_BASE_PATH-$ARDUINO_SDK_VERSION"
24+
- mkdir -p "$sdk_path"
25+
- cd "$sdk_path/.." # Get to arduino-sdk
1726
- |
1827
if [[ $TRAVIS_OS_NAME == linux ]]; then
19-
export ARDUINO_SDK_FILE="arduino-$ARDUINO_SDK_VERSION-linux64.tar.xz"
28+
sdk_file="arduino-$ARDUINO_SDK_VERSION-linux64.tar.xz"
2029
else
21-
export ARDUINO_SDK_FILE="arduino-$ARDUINO_SDK_VERSION-macosx.zip"
30+
sdk_file="arduino-$ARDUINO_SDK_VERSION-macosx.zip"
2231
fi
23-
- wget "https://downloads.arduino.cc/$ARDUINO_SDK_FILE" -O "$ARDUINO_SDK_FILE"
24-
- mkdir arduino-sdk
32+
- wget "https://downloads.arduino.cc/$sdk_file" -O "$sdk_file"
2533
- |
2634
if [[ $TRAVIS_OS_NAME == linux ]]; then
27-
tar xf "$ARDUINO_SDK_FILE" -C arduino-sdk --strip-components 1
28-
export ARDUINO_SDK_PATH="$PWD/arduino-sdk"
35+
tar xf "$sdk_file" --strip-components 1
2936
else
30-
unzip "$ARDUINO_SDK_FILE" "Arduino.app/Contents/Java/*" -d arduino-sdk
31-
export ARDUINO_SDK_PATH="$(pwd)/arduino-sdk/Arduino.app/Contents/Java"
37+
unzip "$sdk_file"
3238
fi
39+
- export ARDUINO_SDK_PATH="$sdk_path"
3340
install:
41+
- cd "$TRAVIS_BUILD_DIR"
3442
- mkdir build
3543
- rm -rf build/*
3644
- cd build/

0 commit comments

Comments
 (0)