Skip to content
103 changes: 103 additions & 0 deletions .github/workflows/ci-windows-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: PyCppAD CI for Windows - Clang
on:
pull_request:
push:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
name: [windows-latest-clang-cl]

include:
- name: windows-latest-clang-cl
os: windows-2019
compiler: clang-cl

steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init
- uses: goanpeca/setup-miniconda@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
activate-environment: pycppad
environment-file: .github/workflows/conda/conda-env-win.yml
python-version: 3.7
- name: Install cmake and update conda
run: |
conda install cmake -c main
- name: Build CppADCodeGen, CppAD, PyCppAD
shell: cmd /C CALL {0}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
:: unset extra Boost envs
set Boost_ROOT=
set BOOST_ROOT_1_69_0=
set BOOST_ROOT_1_72_0=
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%

call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64

:: Create build directory
git clone --recursive https://github.com/proyan/CppAD
cd CppAD
mkdir build
pushd build
cmake ^
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
..
cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target check install
cd ${{github.workspace}}/CppAD/build/

cd ${{github.workspace}}

git clone --recursive https://github.com/joaoleal/CppADCodeGen
cd CppADCodeGen
mkdir build
pushd build
cmake ^
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DGOOGLETEST_GIT=ON ^
..
cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install
cd ${{github.workspace}}


mkdir build
pushd build


:: Configure
cmake ^
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON ^
..

:: Build
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install

:: Testing
set PATH=%PATH%;%CONDA_PREFIX%\Lib\site-packages\pycppad
ctest --output-on-failure -C Release -V

:: Test Python import
cd ..
python -c "import pycppad"
8 changes: 8 additions & 0 deletions .github/workflows/conda/conda-env-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: pycppad
channels:
- conda-forge
- nodefaults
dependencies:
- boost
- eigenpy
- python