.travis.yml 2.33 KB
Newer Older
1 2 3 4 5 6 7
################################################################################
# Ocarina travis-ci configuration file.
# This script compiles and test Ocarina for Linux and OS X targets
#
# Note: this travis-ci script is adapted from
# https://github.com/AdaCore/Ada_Drivers_Library
#
8
# Thanks to AdaCore for providing it
9

10 11 12 13 14
################################################################################
# Note: we are using Python to run Ocarina testsuite. We install a
# specific GNAT GPL release to compile and run everything.

language: generic
15 16 17 18 19

# Global variables
env:
  global:
    - TOOLS_DIR=$HOME/build_tools
20
    - GNAT_TAR_PATH=$TOOLS_DIR/gnat-gpl-2016-bin.tar.gz
21

22 23
################################################################################
# Host to run the various tests
24 25
os:
  - linux
yoogx's avatar
yoogx committed
26
  - osx
27

28 29 30 31 32 33 34
################################################################################
# Build only for the master branch
branches:
  only:
  - master

################################################################################
35 36
# Cache directory that allows us to not download GNAT GPL every time, speeding
# up the process.
37

38 39 40 41
cache:
  directories:
  - $HOME/build_tools

42 43
before_install:
- which python
yoogx's avatar
yoogx committed
44 45 46

#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update          ; fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python --universal --framework ; fi
47

48 49 50
install:
  # Check if the GNAT package is already available in the cache directory. If
  # not, download it.
yoogx's avatar
yoogx committed
51 52
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -f  $GNAT_TAR_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/5739cefdc7a447658e0b016b -O $GNAT_TAR_PATH); fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then test -f  $GNAT_TAR_PATH ||( mkdir -p $TOOLS_DIR && wget http://mirrors.cdn.adacore.com/art/573a396cc7a447658d00e430 -O $GNAT_TAR_PATH); fi
53 54 55 56 57

  # Extract GNAT from its package
  - tar -xf $GNAT_TAR_PATH

  # Add GNAT to $PATH
yoogx's avatar
yoogx committed
58
  - export PATH=$PWD/gnat-gpl-2016-x86_64-linux-bin/bin/:$PWD/gnat-gpl-2016-x86_64-darwin-bin/bin/:$PATH
59

60 61 62
################################################################################
# Main processing starts here

63
script:
yoogx's avatar
yoogx committed
64 65 66 67
  # Show GNAT version for the record
  - gcc --version
  - gnatls -v

68
  # Just build
yoogx's avatar
yoogx committed
69
  - git clone https://github.com/OpenAADL/ocarina-build.git ; ( cd ocarina-build ; ./build_ocarina.sh --scenario=travis-ci )