CI: conda setup using conda-incubator/setup-miniconda #18
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: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: bagbuild | |
- run: | | |
echo "Installing dependencies..." | |
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 | |
echo "Configuring CMake..." | |
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/bagbuild/Library \ | |
-DHDF5_ROOT=/Miniconda/envs/bagbuild/Library \ | |
-DBAG_BUILD_TESTS:BOOL=ON \ | |
-DBAG_BUILD_PYTHON:BOOL=ON \ | |
-DBAG_CI=ON \ | |
-DCMAKE_OBJECT_PATH_MAX=1024 | |
echo "Building..." | |
cmake --build build | |
python -m pip wheel -w ./wheel build/api/swig/python | |
echo "Installing..." | |
cmake --install build | |
python -m pip install ./wheel/bagPy-*.whl | |
echo "Running C++ tests..." | |
export BAG_SAMPLES_PATH=${github.workspace}/examples/sample-data | |
./build/tests/bag_tests | |
echo "Running Python tests..." | |
python -m pytest --cov=bagPy --cov-branch --cov-report=xml --junitxml=python-test-results.xml python/test_*.py |