Skip to content

Commit

Permalink
Merge pull request #4 from allanleal/enable-ci
Browse files Browse the repository at this point in the history
Implement travis and appveyor ci recipes
  • Loading branch information
allanleal authored Aug 9, 2019
2 parents 3905f89 + d5161be commit 1395c7e
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: cpp

os:
- linux
- osx

cache:
directories:
- $HOME/miniconda

install:
- bash ci/travis/install.sh

script:
- bash ci/travis/test.sh

before_cache:
- rm -f $HOME/miniconda/envs/thermofun/conda-meta/history* # Delete these history files to prevent a new cache upload step.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.0)

# Set the name of the project
project(ThermoFun VERSION 0.1.5 LANGUAGES CXX)
project(ThermoFun VERSION 0.1.10 LANGUAGES CXX)

# Set the cmake module path of the project
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
Expand All @@ -23,7 +23,7 @@ option(TFUN_BUILD_SHARED_LIBS "Build shared libraries." ON)
option(TFUN_BUILD_STATIC_LIBS "Build static libraries." ON)
#option(TFUN_BUILD_TESTS "Build tests." OFF)
option(TFUN_BUILD_GUI "Build ThermoFunGui library." OFF)
option(TFUN_BUILD_HUBCLIENT "Build ThermoFun with ThermoHubClient." ON)
option(TFUN_BUILD_HUBCLIENT "Build ThermoFun with ThermoHubClient." OFF)
option(TFUN_BUILD_GUIDEMO "Build ThermoFunGui demo." OFF)
option(TFUN_BUILD_PYTHON "Build the python wrappers and python package thermofun." OFF)
#option(REFRESH_THIRDPARTY "Refresh thirdparty libraries." OFF)
Expand Down
30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
image:
# - Visual Studio 2015
- Visual Studio 2017

build:
parallel: true

platform:
- x64

configuration:
- Release

environment:
CONDA_DIR: C:\Miniconda36-x64

matrix:
fast_finish: true

init:
- set PATH=%CONDA_DIR%;%CONDA_DIR%\Scripts;%CONDA_DIR%\Library\bin;%PATH%

install:
- call ci\appveyor\install.bat

build_script:
- call ci\appveyor\build.bat

test_script:
- call ci\appveyor\test.bat
12 changes: 12 additions & 0 deletions ci/appveyor/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
)
if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
)

echo "Configuring..."
cmake -S . -B build
echo "Building..."
cmake --build build --config %CONFIGURATION% --target install
7 changes: 7 additions & 0 deletions ci/appveyor/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv
conda update -q conda
conda info -a
conda devenv
call activate thermofun
1 change: 1 addition & 0 deletions ci/appveyor/test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REM call build\test\%CONFIGURATION%\tests.exe
24 changes: 24 additions & 0 deletions ci/travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if [ ! -f $HOME/miniconda/bin/conda ]; then
echo "Downloading and installing miniconda"
if [ $TRAVIS_OS_NAME = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-$OS.sh
rm -rf $HOME/miniconda
bash miniconda.sh -b -p $HOME/miniconda
fi
if [ ! -f $HOME/miniconda/bin/conda ]; then
echo ERROR: conda was not installed.
exit 1
fi
bash $HOME/miniconda/etc/profile.d/conda.sh
export PATH=$HOME/miniconda/bin/:$PATH
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv
conda update -q conda
conda info -a
conda devenv
source activate thermofun
mkdir build
cd build
cmake .. -GNinja
ninja
1 change: 1 addition & 0 deletions ci/travis/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ./build/test/tests

0 comments on commit 1395c7e

Please sign in to comment.