forked from pascallanger/DIY-Multiprotocol-TX-Module-Boards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
119 lines (97 loc) · 5.33 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
os: linux
dist: bionic
language: c
env:
global:
- IDE_VERSION=1.8.9
matrix:
- BOARD="multi4in1:avr:multiatmega328p:bootloader=none"
- BOARD="multi4in1:avr:multiatmega328p:bootloader=optiboot"
- BOARD="multi4in1:avr:multixmega32d4"
- BOARD="multi4in1:stm32f1:multi5in1t18int"
- BOARD="multi4in1:stm32f1:multistm32f103cb:debug_option=none"
- BOARD="multi4in1:stm32f1:multistm32f103cb:debug_option=native"
- BOARD="multi4in1:stm32f1:multistm32f103cb:debug_option=ftdi"
- BOARD="multi4in1:stm32f1:multistm32f103c8:debug_option=none"
notifications:
email: false
before_install:
# Publish the buildroot script folder
- chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/*
- export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${PATH}
# Install Arduino IDE
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
- mv arduino-$IDE_VERSION $HOME/arduino-ide
- export PATH=$PATH:$HOME/arduino-ide
# Install Arduino CLI
- mkdir ~/arduino-cli
- curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/arduino-cli sh;
- export PATH=$PATH:$HOME/arduino-cli
# Update the board url and package index
- arduino-cli core update-index
# Install the AVR board if needed
- if [[ "$BOARD" =~ "multi4in1:avr:" ]]; then
arduino-cli core install arduino:avr;
fi
# Install ARM toolchain
- wget http://downloads.arduino.cc/gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz
- tar xzf gcc-arm-none-eabi-4.8.3-2014q1-linux64.tar.gz
- mv gcc-arm-none-eabi-4.8.3-2014q1 $HOME/gcc-arm-none-eabi
# Clone the Multi-Module repository
- git clone https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
- buildMulti() { arduino --pref runtime.tools.arm-none-eabi-gcc.path=${HOME}/gcc-arm-none-eabi --verify --board $BOARD ${TRAVIS_BUILD_DIR}/DIY-Multiprotocol-TX-Module/Multiprotocol/Multiprotocol.ino; }
- buildMultiCli() { arduino-cli compile --build-properties runtime.tools.arm-none-eabi-gcc.path=${HOME}/gcc-arm-none-eabi -b $BOARD ${TRAVIS_BUILD_DIR}/DIY-Multiprotocol-TX-Module/Multiprotocol/Multiprotocol.ino; }
# Arduino IDE adds a lot of noise caused by network traffic; firewall it
- sudo iptables -P INPUT DROP
- sudo iptables -P FORWARD DROP
- sudo iptables -P OUTPUT ACCEPT
- sudo iptables -A INPUT -i lo -j ACCEPT
- sudo iptables -A OUTPUT -o lo -j ACCEPT
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
install:
# Copy Multi Boards to the IDE folder
- mkdir -p $HOME/arduino-ide/hardware/multi4in1/
- cp -r ${TRAVIS_BUILD_DIR}/source/avr $HOME/arduino-ide/hardware/multi4in1/avr
- cp -r ${TRAVIS_BUILD_DIR}/source/stm32 $HOME/arduino-ide/hardware/multi4in1/stm32f1
- mkdir -p $HOME/Arduino/
- ln -s $HOME/arduino-ide/hardware $HOME/Arduino/hardware
before_script:
# Change current working directory to the build dir
- cd ${TRAVIS_BUILD_DIR}
# Log the initial Multi config
- cat DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h
# Derive the Multi protocols from the Multi source
- A7105_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]]*_A7105_INO\)\(.*\)/\1/p' DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h)
- CC2500_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]]*_CC2500_INO\)\(.*\)/\1/p' DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h)
- CYRF6936_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]]*_CYRF6936_INO\)\(.*\)/\1/p' DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h)
- NRF24L01_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]]*_NRF24L01_INO\)\(.*\)/\1/p' DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h)
- SX1276_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_SX1276_INO\)\(.*\)/\1/p' DIY-Multiprotocol-TX-Module/Multiprotocol/_Config.h)
# Get the full set of protocols for each board
- if [[ "$BOARD" =~ "multi4in1:avr:multixmega32d4" ]]; then
ALL_PROTOCOLS=$(echo $CYRF6936_PROTOCOLS);
elif [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
ALL_PROTOCOLS=$(echo $A7105_PROTOCOLS $CC2500_PROTOCOLS $CYRF6936_PROTOCOLS $NRF24L01_PROTOCOLS);
elif [[ "$BOARD" =~ "multi4in1:stm32f1:" ]]; then
ALL_PROTOCOLS=$(echo $A7105_PROTOCOLS $CC2500_PROTOCOLS $CYRF6936_PROTOCOLS $NRF24L01_PROTOCOLS $SX1276_PROTOCOLS);
fi
- echo $ALL_PROTOCOLS
# Enable CHECK_FOR_BOOTLOADER when needed
- if [[ "$BOARD" =~ ":bootloader=optiboot" ]]; then
opt_enable CHECK_FOR_BOOTLOADER;
fi
# Trim the build down for the Atmega328p board
- if [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
opt_disable $ALL_PROTOCOLS
opt_enable FRSKYX_CC2500_INO AFHDS2A_A7105_INO MJXQ_NRF24L01_INO DSM_CYRF6936_INO;
fi
# Trim the enabled protocols down for the STM32F103CB board with debugging or the STM32F103C8 board in general
- if [[ "$BOARD" == "multi4in1:stm32f1:multistm32f103cb:debug_option=ftdi" ]] || [[ "$BOARD" == "multi4in1:stm32f1:multistm32f103cb:debug_option=native" ]] || [[ "$BOARD" =~ "multi4in1:stm32f1:multistm32f103c8" ]]; then
opt_disable $ALL_PROTOCOLS;
opt_enable FRSKYX_CC2500_INO AFHDS2A_A7105_INO MJXQ_NRF24L01_INO DSM_CYRF6936_INO;
fi
script:
# Build using the Arduino IDE
- buildMulti
# Build using Arduino CLI
- buildMultiCli