Skip to content

Commit

Permalink
Exchanged appveyor with azure pipelines for windows (#30)
Browse files Browse the repository at this point in the history
* switch to VS2019

* trying to add azure win64 build

* added batch script for build in windows

* try to fix python install path on win

* fix conda activate

* test for VS2019

* added azure pipelines build badge

Co-authored-by: G. Dan Miron <[email protected]>
  • Loading branch information
gdmiron and G. Dan Miron authored Jan 5, 2022
1 parent f1ce533 commit 7e11815
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 8 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ThermoFun
[![Build Status](https://travis-ci.com/thermohub/thermofun.svg?branch=master)](https://travis-ci.com/thermohub/thermofun)
[![Build status](https://ci.appveyor.com/api/projects/status/j4ex4bwl8u8crg3q/branch/master?svg=true)](https://ci.appveyor.com/project/gdmiron/thermofun-bus2d/branch/master)
Linux, OSX, Windows

A code for calculating the standard state thermodynamic properties at a given temperature and pressure.
[![Build Status](https://dev.azure.com/mirondanro/thermohub/_apis/build/status/thermohub.thermofun?branchName=master)](https://dev.azure.com/mirondanro/thermohub/_build/latest?definitionId=9&branchName=master)

A code for calculating the standard state thermodynamic properties of substances and reactions at a given temperature and pressure.

## Try ThermoFun in your browser click launch binder

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
# - Visual Studio 2015
- Visual Studio 2017
- Visual Studio 2019

build:
parallel: true
Expand Down
64 changes: 64 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,67 @@ jobs:
- task: Bash@3
inputs:
filePath: 'ci/pipelines/install/install-osx.sh'

- job: win64
pool:
vmImage: 'windows-2019'
strategy:
matrix:
Python37:
python.version: '3.7'

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- script: |
conda config --system --set always_yes yes --set changeps1 no
conda config --system --append channels conda-forge
conda install -n base conda-devenv
conda update -q conda
conda info -a
conda devenv
call activate thermofun
displayName: Create Anaconda environment
- task: BatchScript@1
inputs:
filename: 'ci/pipelines/install.bat'

- script: |
call activate thermofun
conda list
call python -c "import thermofun"
displayName: Test
- job: win64_VS
pool:
vmImage: 'windows-2019'
strategy:
matrix:
Python37:
python.version: '3.7'

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- script: |
conda config --system --set always_yes yes --set changeps1 no
conda config --system --append channels conda-forge
conda install -n base conda-devenv
conda update -q conda
conda info -a
conda devenv
call activate thermofun
displayName: Create Anaconda environment
- task: BatchScript@1
inputs:
filename: 'ci/pipelines/installVS.bat'

- script: |
call activate thermofun
conda list
call python -c "import thermofun"
displayName: Test
6 changes: 3 additions & 3 deletions ci/appveyor/build.bat
Original file line number Diff line number Diff line change
@@ -1,12 +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 2019" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\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 -G"Visual Studio 15 2017" -DTHERMOFUN_PYTHON_INSTALL_PREFIX:PATH="C:/Miniconda36-x64/envs/thermofun/" -A x64 -S . -B build
cmake -G"Visual Studio 16 2019" -DTHERMOFUN_PYTHON_INSTALL_PREFIX:PATH="C:/Miniconda36-x64/envs/thermofun/" -A x64 -S . -B build
echo "Building..."
cmake --build build --config %CONFIGURATION% --target install
27 changes: 27 additions & 0 deletions ci/pipelines/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
rem Copyright (C) 2022 dmiron
rem
rem This file is part of thermofun.
rem
rem thermofun is free software: you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem thermofun is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem GNU General Public License for more details.
rem
rem You should have received a copy of the GNU General Public License
rem along with thermofun. If not, see <http://www.gnu.org/licenses/>.

mkdir build
cd build

call activate thermofun

cmake -G Ninja ^
-DTHERMOFUN_PYTHON_INSTALL_PREFIX:PATH="%CONDA_PREFIX%" ^
-DCMAKE_BUILD_TYPE=Release ^
..
ninja install
2 changes: 1 addition & 1 deletion ci/pipelines/install/install-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ conda install conda-devenv
conda update -q conda
conda info -a
conda devenv
source activate GEMS3K
source activate thermofun
mkdir build
cd build
# Configure step
Expand Down
25 changes: 25 additions & 0 deletions ci/pipelines/installVS.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
rem Copyright (C) 2022 dmiron
rem
rem This file is part of thermofun.
rem
rem thermofun is free software: you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem thermofun is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem GNU General Public License for more details.
rem
rem You should have received a copy of the GNU General Public License
rem along with thermofun. If not, see <http://www.gnu.org/licenses/>.

call activate thermofun

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"

echo "Configuring..."
cmake -G"Visual Studio 16 2019" -DTHERMOFUN_PYTHON_INSTALL_PREFIX:PATH="%CONDA_PREFIX%" -A x64 -S . -B build
echo "Building..."
cmake --build build --config %CONFIGURATION% --target install
1 change: 1 addition & 0 deletions environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: thermofun

dependencies:
- pip
- setuptools=59.7.0
- gxx_linux-64=7.3.0 # [linux]
- cmake>=3.13
- ninja
Expand Down

0 comments on commit 7e11815

Please sign in to comment.