File: .travis.yml

package info (click to toggle)
soapysdr 0.6.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 796 kB
  • sloc: cpp: 3,787; ansic: 428; python: 218; makefile: 18; sh: 11
file content (83 lines) | stat: -rw-r--r-- 3,191 bytes parent folder | download
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
########################################################################
## Travis CI config for SoapySDR
##
## * matrix tests compilers and build types
## * python bindings built and installed
## * python3 bindings built and installed
## * minimal testing for command line util
## * minimal testing for python bindings
########################################################################

sudo: required
dist: trusty

language: cpp

matrix:
  include:
    - os: linux
      compiler: gcc
      env: PYTHON_EXECUTABLE=/usr/bin/python PYTHON3_EXECUTABLE=/usr/bin/python3
    - os: osx
      compiler: clang
      env: PYTHON_EXECUTABLE=/usr/local/bin/python2 PYTHON3_EXECUTABLE=/usr/local/bin/python3

env:
  global:
    - INSTALL_PREFIX=/usr/local
    - BUILD_TYPE=Release

# whitelist
branches:
  only:
    - master
    - maint

install:

  # install python support dependencies
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -qq python python-dev python-numpy swig; fi;

  # install python3 support dependencies
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -qq python3 python3-dev python3-numpy swig; fi;

  # install osx python and python2 dependencies
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install swig python2 python3 ; fi

script:
  - mkdir build
  - cd build
  - cmake ../ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_PYTHON_CONFIG=ON -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DPYTHON3_EXECUTABLE=${PYTHON3_EXECUTABLE}
  - make
  - sudo make install

  # setup environment paths
  - export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
  - export PATH=${INSTALL_PREFIX}/bin:${PATH}

  # basic test for command line utility
  - SoapySDRUtil --info
  - SoapySDRUtil --check=null
  - SoapySDRUtil --make="driver=null"

  # basic test for python bindings
  - export PYTHONPATH=$(${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix='${INSTALL_PREFIX}'))")
  - echo ${PYTHONPATH}
  - ${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.getAPIVersion())"
  - ${PYTHON_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_ABI_VERSION)"
  - ${PYTHON_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_TIMEOUT)"
  - ${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.errToStr(SoapySDR.SOAPY_SDR_TIMEOUT))"
  - ${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.Device.make('driver=null'))"

  # basic test for python3 bindings
  - export PYTHONPATH=$(${PYTHON3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix='${INSTALL_PREFIX}'))")
  - echo ${PYTHONPATH}
  - ${PYTHON3_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.getAPIVersion())"
  - ${PYTHON3_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_ABI_VERSION)"
  - ${PYTHON3_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_TIMEOUT)"
  - ${PYTHON3_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.errToStr(SoapySDR.SOAPY_SDR_TIMEOUT))"
  - ${PYTHON3_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.Device.make('driver=null'))"

  # run unit tests
  - make test