Avoid to consume too much memory while building #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyCppAD CI for Windows | |
on: | |
pull_request: | |
push: | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
BUILD_CPPAD_CODEGEN: OFF | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [windows-2019] | |
compiler: [cl, clang-cl] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: pycppad | |
auto-update-conda: true | |
environment-file: .github/workflows/conda/conda-env-win.yml | |
python-version: 3.8 | |
auto-activate-base: false | |
- name: Setup cppad codegen | |
if: contains(matrix.compiler, 'clang') | |
shell: cmd /C CALL {0} | |
run: | | |
conda install cppadcodegen | |
echo "BUILD_CPPAD_CODEGEN=ON" >> "$GITHUB_ENV" | |
- name: Build PyCppAD | |
shell: cmd /C CALL {0} | |
env: | |
CC: ${{ matrix.compiler }} | |
CXX: ${{ matrix.compiler }} | |
run: | | |
:: Create build directory | |
mkdir build | |
pushd build | |
:: Configure | |
cmake ^ | |
-G "Ninja" ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ | |
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^ | |
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^ | |
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=%BUILD_CPPAD_CODEGEN% ^ | |
.. | |
:: Build | |
ninja -j1 | |
:: Testing | |
ctest --output-on-failure -C Release -V | |
:: Test Python import | |
ninja install | |
cd .. | |
python -c "import pycppad" |