Skip to content

Commit 57b5296

Browse files
authored
Add Windows-clang CI (#18)
* CI test for coin-or/CppAD#112 * fix path * fix command * build dir fix * fix * fix * add getest * remove gtest. add source * fix * use local cppad to check support * [ci-windows] make check on cppad * [ci] make check in cppad/build * [ci][windows] make check before make install * [ci][windows] try cmake --target check install Co-authored-by: Rohan Budhiraja <[email protected]>
1 parent b726f21 commit 57b5296

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: PyCppAD CI for Windows - Clang
2+
on:
3+
pull_request:
4+
push:
5+
6+
env:
7+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
8+
BUILD_TYPE: Release
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
name: [windows-latest-clang-cl]
17+
18+
include:
19+
- name: windows-latest-clang-cl
20+
os: windows-2019
21+
compiler: clang-cl
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Checkout submodules
26+
run: |
27+
git submodule update --init
28+
- uses: goanpeca/setup-miniconda@v1
29+
env:
30+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
31+
with:
32+
activate-environment: pycppad
33+
environment-file: .github/workflows/conda/conda-env-win.yml
34+
python-version: 3.7
35+
- name: Install cmake and update conda
36+
run: |
37+
conda install cmake -c main
38+
- name: Build CppADCodeGen, CppAD, PyCppAD
39+
shell: cmd /C CALL {0}
40+
env:
41+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
42+
run: |
43+
:: unset extra Boost envs
44+
set Boost_ROOT=
45+
set BOOST_ROOT_1_69_0=
46+
set BOOST_ROOT_1_72_0=
47+
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%
48+
49+
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
50+
51+
:: Create build directory
52+
git clone --recursive https://github.com/proyan/CppAD
53+
cd CppAD
54+
mkdir build
55+
pushd build
56+
cmake ^
57+
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
58+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
59+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
60+
..
61+
cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target check install
62+
cd ${{github.workspace}}/CppAD/build/
63+
64+
cd ${{github.workspace}}
65+
66+
git clone --recursive https://github.com/joaoleal/CppADCodeGen
67+
cd CppADCodeGen
68+
mkdir build
69+
pushd build
70+
cmake ^
71+
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
72+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
73+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
74+
-DGOOGLETEST_GIT=ON ^
75+
..
76+
cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install
77+
cd ${{github.workspace}}
78+
79+
80+
mkdir build
81+
pushd build
82+
83+
84+
:: Configure
85+
cmake ^
86+
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
87+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
88+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
89+
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
90+
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
91+
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON ^
92+
..
93+
94+
:: Build
95+
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
96+
97+
:: Testing
98+
set PATH=%PATH%;%CONDA_PREFIX%\Lib\site-packages\pycppad
99+
ctest --output-on-failure -C Release -V
100+
101+
:: Test Python import
102+
cd ..
103+
python -c "import pycppad"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: pycppad
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- boost
7+
- eigenpy
8+
- python

0 commit comments

Comments
 (0)