From a00e5ae3f369f173c09bf6a0d00e06a9a95af201 Mon Sep 17 00:00:00 2001 From: Allan Leal Date: Fri, 9 Aug 2019 14:40:16 +0200 Subject: [PATCH 1/3] Implement travis and appveyor ci recipes --- .travis.yml | 18 ++++++++++++++++++ appveyor.yml | 30 ++++++++++++++++++++++++++++++ ci/appveyor/build.bat | 12 ++++++++++++ ci/appveyor/install.bat | 7 +++++++ ci/appveyor/test.bat | 1 + ci/travis/install.sh | 24 ++++++++++++++++++++++++ ci/travis/test.sh | 1 + 7 files changed, 93 insertions(+) create mode 100644 .travis.yml create mode 100644 appveyor.yml create mode 100644 ci/appveyor/build.bat create mode 100644 ci/appveyor/install.bat create mode 100644 ci/appveyor/test.bat create mode 100644 ci/travis/install.sh create mode 100644 ci/travis/test.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bee8bb8c --- /dev/null +++ b/.travis.yml @@ -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. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..835510a8 --- /dev/null +++ b/appveyor.yml @@ -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 diff --git a/ci/appveyor/build.bat b/ci/appveyor/build.bat new file mode 100644 index 00000000..8e365730 --- /dev/null +++ b/ci/appveyor/build.bat @@ -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 diff --git a/ci/appveyor/install.bat b/ci/appveyor/install.bat new file mode 100644 index 00000000..315acb3f --- /dev/null +++ b/ci/appveyor/install.bat @@ -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 diff --git a/ci/appveyor/test.bat b/ci/appveyor/test.bat new file mode 100644 index 00000000..b7b57672 --- /dev/null +++ b/ci/appveyor/test.bat @@ -0,0 +1 @@ +REM call build\test\%CONFIGURATION%\tests.exe \ No newline at end of file diff --git a/ci/travis/install.sh b/ci/travis/install.sh new file mode 100644 index 00000000..b95f5b45 --- /dev/null +++ b/ci/travis/install.sh @@ -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 \ No newline at end of file diff --git a/ci/travis/test.sh b/ci/travis/test.sh new file mode 100644 index 00000000..6720d5ce --- /dev/null +++ b/ci/travis/test.sh @@ -0,0 +1 @@ +# ./build/test/tests \ No newline at end of file From 25e73b7ca7721c5dc814e52836538ba1f773c39b Mon Sep 17 00:00:00 2001 From: Allan Leal Date: Fri, 9 Aug 2019 14:56:05 +0200 Subject: [PATCH 2/3] Increment version to 0.1.10 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e265619..15824234 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") From d5161bebb08fc1a7a01dcbc6698cd470c1fe8090 Mon Sep 17 00:00:00 2001 From: Allan Leal Date: Fri, 9 Aug 2019 15:05:33 +0200 Subject: [PATCH 3/3] Prevent ThermoHubClient from building by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15824234..2ec9e00a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)