forked from mcci-catena/arduino-lorawan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
129 lines (117 loc) · 8.57 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Travis script for test-building this library.
dist: trusty
sudo: false
# Thanks, https://stackoverflow.com/questions/27644586/how-to-set-up-travis-ci-with-multiple-languages !
matrix:
include:
# C language tests
- language: c
before_install:
# sudo apt-get install libc6-i386
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-1.8.5-linux64.tar.xz
- tar xf arduino-1.8.5-linux64.tar.xz
- mv arduino-1.8.5 $HOME/arduino_ide
- export PATH="$HOME/arduino_ide:$PATH"
#
# arduino_lorawan looks for project_config things, so we must put
# things in the canonical place
#
- export THISLIB="$HOME/arduino_ide/libraries/arduino-lorawan"
- ln -s $PWD $THISLIB
#
# functions to generate the board settings for SAMD, STM32L0, ...
# keep args for these aligned for any common options. $1 is always board name, $2 is region.
#
# Changes to the BSP may break this build, sorry!
#
- "function _samdopts { echo mcci:samd:${1:-mcci_catena_4450}:lorawan_region=${2:-us915} ; }"
- "function _stm32l0opts { echo mcci:stm32:${1:-mcci_catena_4551}:lorawan_region=${2:-us915},opt=${3:-osstd},xserial=${4:-generic},usb=${5:-none},upload_method=${6:-STLink} ; }"
#
# Put one or more arguments into lmic_project_config.h as `#define $i\n`
# If an argument is A=B, produce '#define A B".'
- 'function _projcfg { for i in "$@" ; do echo $i | awk ''BEGIN { FS="=" } { if ($2 == "") $2 = 1; printf("#define %s %s\n", $1, $2); } ''; done > $HOME/arduino_ide/libraries/arduino-lmic/project_config/lmic_project_config.h ; }'
#
# Handy macro to deal with expected failures.
- 'function _expect_failure { if [ $? -eq 0 ]; then echo "Suceeded, but should have failed!" ; echo project_config/lmic_project_config.h ; cat $HOME/arduino_ide/libraries/arduino-lmic/project_config/lmic_project_config.h ; return 1 ; else echo "Failed, as expected"; return 0 ; fi ; }'
#
# modify the board manager preferences to point to our BSPs.
- arduino --pref "boardsmanager.additional.urls=https://github.com/mcci-catena/arduino-boards/raw/master/BoardManagerFiles/package_mcci_index.json" --save-prefs
- export MCCI_STM32_OPTS="--pref recipe.hooks.objcopy.postobjcopy.1.pattern=true"
install:
- git clone --depth=1 https://github.com/mcci-catena/Catena-mcciadk.git $HOME/arduino_ide/libraries/Catena-mcciadk
- git clone --depth=1 https://github.com/mcci-catena/arduino-lmic.git $HOME/arduino_ide/libraries/arduino-lmic
- arduino --install-boards mcci:samd
- arduino --install-boards mcci:stm32
script:
#
# show the output of the config commands for reference.
- "echo $(_stm32l0opts) $(_stm32l0opts '' projcfg)"
- "echo $(_samdopts) $(_samdopts '' projcfg)"
#
# test each of the regions for SAMD.
- arduino --verify --board $(_samdopts '' us915) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_samdopts '' eu868) $THISLIB/examples/header_test/header_test.ino
# V1.1.0 of the samd bsp doesn't support au921 correctly -- test with projcfg
# - arduino --verify --board $(_samdopts '' au921) $THISLIB/examples/header_test/header_test.ino
- _projcfg CFG_au921 CFG_sx1276_radio && arduino --verify --board $(_samdopts '' projcfg) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_samdopts '' as923) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_samdopts '' as923jp) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_samdopts '' in866) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_samdopts '' us915) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_samdopts '' eu868) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
# V1.1.0 of the samd bsp doesn't support au921 correctly -- test with projcfg
# - arduino --verify --board $(_samdopts '' au921) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- _projcfg CFG_au921 CFG_sx1276_radio && arduino --verify --board $(_samdopts '' projcfg) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_samdopts '' as923) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_samdopts '' as923jp) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_samdopts '' in866) $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_samdopts '' us915) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_samdopts '' eu868) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
# V1.1.0 of the samd bsp doesn't support au921 correctly -- test with projcfg
# - arduino --verify --board $(_samdopts '' au921) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- _projcfg CFG_au921 CFG_sx1276_radio && arduino --verify --board $(_samdopts '' projcfg) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_samdopts '' as923) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_samdopts '' as923jp) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_samdopts '' in866) $THISLIB/examples/header_test_ttn/header_test_ttn.ino
#
# *** TESTS FOR STM32L0 / Catena 4551 ****
- arduino --verify --board $(_stm32l0opts '' us915 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' eu868 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' au921 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' as923 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' as923jp) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' in866 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts '' us915 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' eu868 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' au921 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' as923 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' as923jp) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' in866 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_lmic/header_test_lmic.ino
- arduino --verify --board $(_stm32l0opts '' us915 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_stm32l0opts '' eu868 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_stm32l0opts '' au921 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_stm32l0opts '' as923 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_stm32l0opts '' as923jp) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
- arduino --verify --board $(_stm32l0opts '' in866 ) $MCCI_STM32_OPTS $THISLIB/examples/header_test_ttn/header_test_ttn.ino
# PlatformIO dependency test
- language: python
python: 2.7
#env:
# - PLATFORMIO_CI_SRC=path/to/test/file.c
# - PLATFORMIO_CI_SRC=examples/file.ino
# - PLATFORMIO_CI_SRC=path/to/test/directory
install:
- pip install -U platformio
script:
- cd test_platformio_deps
- mkdir src
- echo "int main() {}" > src/main.cpp
- platformio run
# - platformio ci --lib="." --board=adafruit_feather_m0
cache:
directories:
- "~/.platformio"
### end of file ###