CI: Windows: conda debug #14
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: Test Matrix - Windows | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- appveyor.yml | |
- readme.* | |
- README.* | |
- '*.md' | |
- '*.svg' | |
- '*.png' | |
- .github/workflows/testmatrix.yml | |
- .github/workflows/testreporting.yml | |
branches: [ "master" ] | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- appveyor.yml | |
- readme.* | |
- README.* | |
- '*.md' | |
- '*.svg' | |
- '*.png' | |
- .github/workflows/testmatrix.yml | |
- .github/workflows/testreporting.yml | |
branches: [ "master", "v2" ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.11"] | |
os: [windows-latest] | |
c_compiler: [cl] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Add conda to system path | |
run: | | |
# $CONDA is an environment variable pointing to the root of the miniconda directory | |
echo $CONDA/bin >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
conda config --set always_yes yes --set changeps1 no | |
conda update -q conda | |
conda info -a | |
conda config --add channels conda-forge | |
conda activate base | |
conda install cmake ninja hdf5 gdal libxml2 swig=4.0.1 catch2 unittest-xml-reporting pytest pytest-cov pytest-xdist | |
conda list --show-channel-urls | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: | | |
conda info -a | |
conda activate base | |
cmake -Bbuild -S. -GNinja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
-DCMAKE_C_COMPILER=cl.exe | |
-DCMAKE_CXX_COMPILER=cl.exe | |
-DCMAKE_INSTALL_PREFIX=/Miniconda/envs/test-environment/Library | |
-DHDF5_ROOT=/Miniconda/envs/test-environment/Library | |
-DBAG_BUILD_TESTS:BOOL=ON | |
-DBAG_BUILD_PYTHON:BOOL=ON | |
-DBAG_CI=ON | |
-DCMAKE_OBJECT_PATH_MAX=1024 | |
- name: Build | |
run: | | |
conda activate base | |
cmake --build build | |
python -m pip wheel -w ./wheel build/api/swig/python | |
- name: Install | |
run: | | |
conda activate base | |
cmake --install build | |
python -m pip install ./wheel/bagPy-*.whl | |
- name: Tests | |
# Execute C++ and Python tests | |
run: | | |
conda activate base | |
export BAG_SAMPLES_PATH=${github.workspace}/examples/sample-data | |
./build/tests/bag_tests | |
python -m pytest --cov=bagPy --cov-branch --cov-report=xml --junitxml=python-test-results.xml python/test_*.py |