|
| 1 | +name: PyCppAD CI for Windows - (v142) |
| 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] |
| 17 | + |
| 18 | + include: |
| 19 | + - name: windows-latest |
| 20 | + os: windows-2019 |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + - name: Checkout submodules |
| 25 | + run: | |
| 26 | + git submodule update --init |
| 27 | + - uses: goanpeca/setup-miniconda@v1 |
| 28 | + env: |
| 29 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' |
| 30 | + with: |
| 31 | + activate-environment: pycppad |
| 32 | + environment-file: .github/workflows/conda/conda-env.yml |
| 33 | + python-version: 3.7 |
| 34 | + - name: Install cmake and update conda |
| 35 | + run: | |
| 36 | + conda install cmake -c main |
| 37 | + |
| 38 | + - name: Build 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 | + mkdir build |
| 53 | + pushd build |
| 54 | + |
| 55 | + :: Configure |
| 56 | + cmake ^ |
| 57 | + -G "Visual Studio 16 2019" -T "v142" -DCMAKE_GENERATOR_PLATFORM=x64 ^ |
| 58 | + -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ |
| 59 | + -DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^ |
| 60 | + -DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^ |
| 61 | + -DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=OFF ^ |
| 62 | + .. |
| 63 | + |
| 64 | + :: Build |
| 65 | + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install |
| 66 | + |
| 67 | + :: Testing |
| 68 | + set PATH=%PATH%;%CONDA_PREFIX%\Lib\site-packages\pycppad |
| 69 | + ctest --output-on-failure -C Release -V |
| 70 | + |
| 71 | + :: Test Python import |
| 72 | + cd .. |
| 73 | + python -c "import pycppad" |
0 commit comments