From f642d2fcf0c6fedb8fb8c21008acd525e7ad1781 Mon Sep 17 00:00:00 2001 From: Davide Gerhard Date: Thu, 16 May 2019 13:17:34 +0200 Subject: [PATCH] travis-ci: enabling continuous integration on SDRangel Use travis-ci as continuous integrator with builind for the following operating systems: - ubuntu 16.04; build with gui and without gui - macOS 10.14, 10.13, 10.12, 10.11 with macports This file can be used as build dependency tracker to avoid duplicated information. TODO: - windows 10 NOTE: - ubuntu 18.04 is not supported yet. Azure pipelines has the same limit. [1] http://travis-ci.org --- .travis.yml | 83 +++++++++++++++++++++++++++++++ cmake/travis-ci/build_cm256cc.sh | 10 ++++ cmake/travis-ci/build_codec2.sh | 12 +++++ cmake/travis-ci/build_dsdcc.sh | 10 ++++ cmake/travis-ci/build_sdrangel.sh | 21 ++++++++ 5 files changed, 136 insertions(+) create mode 100644 .travis.yml create mode 100644 cmake/travis-ci/build_cm256cc.sh create mode 100644 cmake/travis-ci/build_codec2.sh create mode 100644 cmake/travis-ci/build_dsdcc.sh create mode 100644 cmake/travis-ci/build_sdrangel.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..032b48050 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,83 @@ +matrix: + include: + - os: linux + dist: xenial + - os: linux + dist: xenial + env: CMAKE_CUSTOM_OPTIONS="-DBUILD_GUI=OFF" + - os: osx + osx_image: xcode10.2 + - os: osx + osx_image: xcode9.4 + - os: osx + osx_image: xcode8.3 + - os: osx + osx_image: xcode7.3 +git: + submodules: false +cache: + directories: + - $HOME/.macports-ci-ccache +language: cpp +addons: + apt: + update: true + # not needed: build-essential cmake git + # need per distro + packages: + - libfftw3-dev + - qtbase5-dev + - libqt5opengl5-dev + - qttools5-dev + - qttools5-dev-tools + - qtmultimedia5-dev + - libqt5multimedia5-plugins + - libusb-1.0-0-dev + - libboost-all-dev + - librtlsdr-dev + - libasound2-dev + - libopencv-dev + - libopencv-dev + - libsqlite3-dev + - libxml2-dev + - bison + - flex + - ffmpeg + - libavcodec-dev + - libavformat-dev + - libopus-dev + - libcodec2-dev + - libairspy-dev + - libhackrf-dev + - librtlsdr-dev +install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source ./macports-ci install; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source macports-ci ccache; fi + # libiio disabled otherwise OpenBLAS compilation timeout + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo port -N -k install libiconv fftw-3-single libusb boost opencv ffmpeg libopus SoapySDR airspy airspyhf bladerf hackrf limesuite rtl-sdr SoapySDRPlay SoapyRemote SoapyAudio; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo port -N -k install perseus-sdr codec2 cm256cc; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo port -N -k install dsdcc +mbelib; fi + # macOS 10.11 doesn't support newest Qt + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$TRAVIS_OSX_IMAGE" == "xcode7.3" ]]; then sudo port -N -k install qt59-qtmultimedia qt59-qttools; else sudo port -N -k install qt5-qtmultimedia qt5-qttools; fi; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source macports-ci ccache --save; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash cmake/travis-ci/build_codec2.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash cmake/travis-ci/build_cm256cc.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash cmake/travis-ci/build_dsdcc.sh; fi +script: + - bash -c export + - bash -c pwd + - bash cmake/travis-ci/build_sdrangel.sh +env: + - CMAKE_CUSTOM_OPTIONS="-DFORCE_SSE41=ON -DBUNDLE=ON -DENABLE_PACK_MIRSDRAPI=ON" +deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + keep_history: true + on: + branch: master + repo: sdrangel-travis-ci + project_name: SDRangel + email: rainbow@irh.it + name: rainbow \ No newline at end of file diff --git a/cmake/travis-ci/build_cm256cc.sh b/cmake/travis-ci/build_cm256cc.sh new file mode 100644 index 000000000..fb2f6f103 --- /dev/null +++ b/cmake/travis-ci/build_cm256cc.sh @@ -0,0 +1,10 @@ + +cd $HOME/build +mkdir f4exb && cd f4exb + +git clone https://github.com/f4exb/cm256cc.git + +cd cm256cc +mkdir build && cd build +cmake .. +sudo make install diff --git a/cmake/travis-ci/build_codec2.sh b/cmake/travis-ci/build_codec2.sh new file mode 100644 index 000000000..be800e16c --- /dev/null +++ b/cmake/travis-ci/build_codec2.sh @@ -0,0 +1,12 @@ + +sudo apt-get install libsamplerate0-dev libspeex-dev libspeexdsp-dev + +cd $HOME/build +mkdir drowe67 && cd drowe67 + +git clone https://github.com/drowe67/codec2.git + +cd codec2 +mkdir build && cd build +cmake .. +sudo make install diff --git a/cmake/travis-ci/build_dsdcc.sh b/cmake/travis-ci/build_dsdcc.sh new file mode 100644 index 000000000..ad257779c --- /dev/null +++ b/cmake/travis-ci/build_dsdcc.sh @@ -0,0 +1,10 @@ + +cd $HOME/build +mkdir f4exb && cd f4exb + +git clone https://github.com/f4exb/dsdcc.git + +cd dsdcc +mkdir build && cd build +cmake .. +sudo make install diff --git a/cmake/travis-ci/build_sdrangel.sh b/cmake/travis-ci/build_sdrangel.sh new file mode 100644 index 000000000..2e2873442 --- /dev/null +++ b/cmake/travis-ci/build_sdrangel.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + JOBS=$(sysctl -n hw.ncpu) +elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + JOBS=$(nproc --all) +else + JOBS=1 +fi + +mkdir build && cd build +cmake .. "${CMAKE_CUSTOM_OPTIONS}" + +case "${CMAKE_CUSTOM_OPTIONS}" in + *BUNDLE=ON*) + make -j${JOBS} package + ;; + *) + make -j${JOBS} + ;; +esac