forked from greatscottgadgets/ubertooth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (85 loc) · 2.94 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
language: c
matrix:
include:
- os: linux
compiler: gcc
cache: apt
dist: xenial
- os: osx
compiler: clang
osx_image: xcode10.2
# workaround for https://travis-ci.community/t/xcode-8-3-homebrew-outdated-error/3798
env:
global:
- SHORT_COMMIT_HASH=`git rev-parse --short HEAD`
- VERSION_STRING=nightly-$SHORT_COMMIT_HASH
- BUILD_NAME="Ubertooth-`date +%Y-%m-%d`-$SHORT_COMMIT_HASH"
- ARTEFACT_BASE=$TRAVIS_BUILD_DIR/artefacts/
- ARTEFACT_PATH=$ARTEFACT_BASE/$BUILD_NAME
addons:
apt:
packages:
- libbluetooth-dev
- libusb-1.0-0-dev
- gcc-arm-none-eabi
- libnewlib-arm-none-eabi
- libstdc++-arm-none-eabi-newlib
- python3-setuptools
homebrew:
taps: PX4/homebrew-px4
packages:
- gcc-arm-none-eabi
update: true
before_script:
# build and install latest libbtbb
- git clone https://github.com/greatscottgadgets/libbtbb.git
- mkdir libbtbb/build
- cd libbtbb/build
- cmake ..
- make
- sudo make install
- export CFLAGS="-Wall -Wextra -Werror -Wno-zero-length-array"
script:
# Host code
- mkdir $TRAVIS_BUILD_DIR/host/build
- cd $TRAVIS_BUILD_DIR/host/build
- cmake ..
- make
- sudo make install
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ldconfig; fi
# Firmware
- cd $TRAVIS_BUILD_DIR/firmware
# Set version string
- sed -e "s/GIT_REVISION=\".*\"/GIT_REVISION=\"$VERSION_STRING\"/" -i".bak" common.mk
# RX only firmware
- mkdir rx_only
- DISABLE_TX=1 make bluetooth_rxtx
- mv bluetooth_rxtx/bluetooth_rxtx.bin rx_only/bluetooth_rx_only.bin
- mv bluetooth_rxtx/bluetooth_rxtx.dfu rx_only/bluetooth_rx_only.dfu
# Regular firmware
- make clean
- make bluetooth_rxtx
# Bootloader firmware
- cd bootloader
- make
after_success:
# Construct archive for deploying to ubertooth-nightlies
- mkdir -p $ARTEFACT_PATH/firmware-bin/
# Put libbtbb in to the archive
- cd $TRAVIS_BUILD_DIR/libbtbb/
- git archive --format=tar --prefix=libbtbb/ HEAD | (cd $ARTEFACT_PATH && tar xf -)
# Export Ubertooth git repo
- cd $TRAVIS_BUILD_DIR/
- git archive --format=tar HEAD | (cd $ARTEFACT_PATH && tar xf -)
# Set version string
- sed -e "s/set(RELEASE.*/set(RELEASE \"$VERSION_STRING\")/" -i".bak" $ARTEFACT_PATH/host/libubertooth/src/CMakeLists.txt
# Copy firmware to firmware-bin directory
- cp $TRAVIS_BUILD_DIR/firmware/rx_only/bluetooth_rx_only.bin $ARTEFACT_PATH/firmware-bin/
- cp $TRAVIS_BUILD_DIR/firmware/rx_only/bluetooth_rx_only.dfu $ARTEFACT_PATH/firmware-bin/
- ls $TRAVIS_BUILD_DIR/firmware/bluetooth_rxtx/
- cp $TRAVIS_BUILD_DIR/firmware/bluetooth_rxtx/bluetooth_rxtx.bin $ARTEFACT_PATH/firmware-bin/
- cp $TRAVIS_BUILD_DIR/firmware/bluetooth_rxtx/bluetooth_rxtx.dfu $ARTEFACT_PATH/firmware-bin/
- cp $TRAVIS_BUILD_DIR/firmware/bootloader/bootloader.bin $ARTEFACT_PATH/firmware-bin/
# Build the archive
- cd $ARTEFACT_BASE
- tar -cJvf $ARTEFACT_BASE/$BUILD_NAME.tar.xz $BUILD_NAME