Skip to content

Commit

Permalink
Add building via Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
h4tr3d committed Mar 28, 2018
1 parent 386c4a5 commit 816dfc0
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Based on https://habrahabr.ru/post/329264/
# Additional GCC / clang versions:
# - https://docs.travis-ci.com/user/languages/cpp/

dist: trusty
sudo: required

language: cpp

os:
- linux
- osx

compiler:
- gcc
- clang

env:
# список переменных окружения, влияющих на матрицу сборки:
- TARGET_CPU=amd64 BUILD_CONFIGURATION=Debug
- TARGET_CPU=amd64 BUILD_CONFIGURATION=Release
#- TARGET_CPU=x86 BUILD_CONFIGURATION=Debug
#- TARGET_CPU=x86 BUILD_CONFIGURATION=Release

matrix:
include:
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"

# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"

exclude:
# exclude some elements from build matrix:
- os: osx
compiler: gcc

# - os: osx
# env: TARGET_CPU=x86 BUILD_CONFIGURATION=Debug
#
# - os: osx
# env: TARGET_CPU=x86 BUILD_CONFIGURATION=Release

before_install:
- eval "${MATRIX_EVAL}"

install:
# setup env:
- source ci/travis/install-$TRAVIS_OS_NAME.sh

script:
# build and test project:
- mkdir build
- cd build
# - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_CONFIGURATION -DTARGET_CPU=$TARGET_CPU
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_CONFIGURATION
- cmake --build .
# - ctest --output-on-failure

#deploy:
# # push tagged-commits to GitHub Releases:
# provider: releases
# file: <package-file>
# skip_cleanup: true
# overwrite: true
#
# api_key:
# secure: <encrypted-github-token>
#
# on:
# tags: true

31 changes: 31 additions & 0 deletions ci/travis/install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -ex

# CMake
(
wget http://www.cmake.org/files/v3.10/cmake-3.10.1.tar.gz
tar -xvzf cmake-3.4.1.tar.gz
cd cmake-3.4.1/
./configure --prefix=/usr
make
sudo make install
)

# FFmpeg
# - https://launchpad.net/~jonathonf/+archive/ubuntu/ffmpeg-3
(
sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo add-apt-repository ppa:jonathonf/tesseract -y
sudo apt update && sudo apt upgrade
sudo apt install libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavresample-dev \
libavutil-dev \
libpostproc-dev \
libswresample-dev \
libswscale-dev
)

6 changes: 6 additions & 0 deletions ci/travis/install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -ex

brew update
brew install ffmpeg

0 comments on commit 816dfc0

Please sign in to comment.