forked from greatscottgadgets/hackrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (87 loc) · 2.71 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
language: c
matrix:
include:
- os: linux
compiler: gcc
cache: apt
dist: xenial
- os: osx
compiler: clang
osx_image: xcode10.3
env:
global:
- SHORT_COMMIT_HASH=`git rev-parse --short HEAD`
- VERSION_STRING=nightly-$SHORT_COMMIT_HASH
- BUILD_NAME="HackRF-`date +%Y-%m-%d`-$SHORT_COMMIT_HASH"
- ARTEFACT_BASE=$TRAVIS_BUILD_DIR/artefacts/
- ARTEFACT_PATH=$ARTEFACT_BASE/$BUILD_NAME
addons:
apt:
packages:
- libusb-1.0-0-dev
- libfftw3-dev
- dfu-util
- gcc-arm-none-eabi
- libnewlib-arm-none-eabi
- libstdc++-arm-none-eabi-newlib
- python-yaml
homebrew:
taps: armmbed/formulae
packages:
- fftw
- arm-none-eabi-gcc
- dfu-util
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install PyYAML; fi
before_script:
- export CFLAGS="-Wall -Wextra -Werror"
script:
# Host code
- mkdir host/build
- cd host/build
- cmake ..
- make
# Firmware
# Set version string
- cd ../../firmware
- sed -e "s/\#set(VERSION.*/set(VERSION \"$VERSION_STRING\")/" -i".bak" hackrf-common.cmake
- mkdir build-hackrf-one
- mkdir build-jawbreaker
- mkdir build-rad1o
- cd libopencm3
- make
- cd ../build-hackrf-one
- cmake ..
- make
- cd ../build-jawbreaker
- cmake -DBOARD=JAWBREAKER ..
- make
- cd ../build-rad1o
- cmake -DBOARD=RAD1O ..
- make
after_success:
# Construct archive for deploying to ubertooth-nightlies
- mkdir -p $ARTEFACT_PATH/firmware-bin/
# Export HackRF 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/cmake/set_release.cmake
# Copy firmware to firmware-bin directory
- cd $TRAVIS_BUILD_DIR/firmware/
- cp cpld/sgpio_if/default.xsvf $ARTEFACT_PATH/firmware-bin/hackrf_cpld_default.xsvf
- cp build-hackrf-one/hackrf_usb/hackrf_usb.bin $ARTEFACT_PATH/firmware-bin/hackrf_one_usb.bin
- cp build-hackrf-one/hackrf_usb/hackrf_usb.dfu $ARTEFACT_PATH/firmware-bin/hackrf_one_usb.dfu
- cp build-jawbreaker/hackrf_usb/hackrf_usb.bin $ARTEFACT_PATH/firmware-bin/hackrf_jawbreaker_usb.bin
- cp build-jawbreaker/hackrf_usb/hackrf_usb.dfu $ARTEFACT_PATH/firmware-bin/hackrf_jawbreaker_usb.dfu
- cp build-rad1o/hackrf_usb/hackrf_usb.bin $ARTEFACT_PATH/firmware-bin/rad1o_usb.bin
- cp build-rad1o/hackrf_usb/hackrf_usb.dfu $ARTEFACT_PATH/firmware-bin/rad1o_usb.dfu
# Build the archive
- cd $ARTEFACT_BASE
- tar -cJvf $ARTEFACT_BASE/$BUILD_NAME.tar.xz $BUILD_NAME
deploy:
provider: script
skip-cleanup: true
script: bash $TRAVIS_BUILD_DIR/tools/deploy-nightly.sh
on:
branch: master