.travis.yml 2.79 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
################################################################################
yoogx's avatar
yoogx committed
11 12 13
# Note: we are using 'generic' as a language. We need GNAT to compile
# Ocarina, and Python to run Ocarina testsuite. We install a specific
# GNAT GPL release to compile and run everything.
14 15

language: generic
16 17 18 19 20

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

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

29
################################################################################
yoogx's avatar
yoogx committed
30 31 32 33
# Install the build environment, derived from travis default installation

# 1/ Cache directory that allows us to not download GNAT GPL every time,
# speeding up the process.
34

35 36 37 38
cache:
  directories:
  - $HOME/build_tools

yoogx's avatar
yoogx committed
39 40
# 2/ Check Python installation

41 42
before_install:
- which python
yoogx's avatar
yoogx committed
43

yoogx's avatar
yoogx committed
44
# 3/ Install GNAT GPL 2016
45

46 47 48
install:
  # Check if the GNAT package is already available in the cache directory. If
  # not, download it.
yoogx's avatar
yoogx committed
49 50
  - 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
51 52 53 54 55

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

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

58 59 60
################################################################################
# Main processing starts here

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

66
  # Just build
67 68 69 70 71
  - git clone https://github.com/OpenAADL/ocarina-build.git ; ( cd ocarina-build ; ./build_ocarina.sh --scenario=travis-ci )

# Codecov.io
after_success:
  - bash <(curl -s https://codecov.io/bash)
72 73 74 75 76 77 78 79

################################################################################
#

deploy:
  provider: releases
  api_key:
    secure: JIs5VZq+T0m42jasHpuDHXjJwgmQNGDaNJos9xHG01b5tvrG9NRIPjB4AFh1RiJBQ8LYFRpcRkrEzbAHs9H4jh7zLrdaAGRo6v0G/h5aowWNGoTiT6sMy5ATX6cuMO/treCEWWEUpUsDy5GSebsRkGhbMjH3d2kZ3933SJIg+kI=
yoogx's avatar
yoogx committed
80
  skip_cleanup: true
81
  file:
yoogx's avatar
yoogx committed
82 83
    - build/OpenAADL/ocarina/ocarina-build/ocarina/ocarina*.tar.gz
    - build/OpenAADL/ocarina/ocarina-build/ocarina/ocarina*.tgz
84
  on:
yoogx's avatar
yoogx committed
85
    tags: true
86
    all_branches: true