Bump Windows GH runner to windows-2022 #881
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: Windows CI | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- "ghxyz" | |
paths: | |
- ".github/actions/**" | |
- ".github/workflows/windows.yml" | |
- "conanfile.py" | |
- "CMakePresets.json" | |
- "CMakeHPXPresets.json" | |
- "environment/cmake/**" | |
- "environment/script/write_conan_profile.py" | |
- "source/**" | |
- "!source/qa/python/qa/**" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: ["windows-2022"] | |
compiler: | |
- { name: "visual studio", c: cl, cxx: cl } | |
vs: | |
# HPX can't be built with toolset 14.39 yet | |
- { name: "Visual Studio Enterprise 2022", version: "17", msvc_toolset: "14.38" } | |
python_version: ["3.9"] | |
architecture: ["amd64"] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} / ${{ matrix.vs.name }} / python - ${{ matrix.python_version }} | |
timeout-minutes: 180 | |
defaults: | |
run: | |
shell: bash -l {0} | |
working-directory: . | |
env: | |
lue_source_directory: lue_source | |
lue_build_directory: lue_build | |
lue_runtime_install_directory: lue_runtime_install | |
lue_development_install_directory: lue_development_install | |
lue_consume_source_directory: lue_consume_source | |
lue_consume_build_directory: lue_consume_build | |
hpx_version: 1.9.1 | |
hpx_source_directory: hpx_source | |
hpx_build_directory: hpx_build | |
hpx_install_directory: hpx_install | |
mdspan_source_directory: mdspan_source | |
mdspan_build_directory: mdspan_build | |
mdspan_install_directory: mdspan_install | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ env.lue_source_directory }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python_version }} | |
channels: conda-forge | |
- name: setup platform | |
run: | | |
# Don't install C++ libraries with Conda. Use Conan for that. The Conan compiler | |
# settings are used when building LUE. Mixing Conda/Conan packages likely results | |
# in conflicts. Make an exception for numpy. Use Conda only for Python packages. | |
# conda-build provides the conda-develop command used below | |
# TODO Use the GDAL Conan package instead of the Conda package, once the GDAL | |
# Conan package actually works | |
# Use different solver than the default to work around "picosat: out of memory in 'new'" | |
conda install -n base -c defaults conda-libmamba-solver | |
conda install --solver=libmamba \ | |
boost-cpp \ | |
"conan>=2" \ | |
conda-build \ | |
docopt \ | |
gdal \ | |
jinja2 \ | |
libhwloc \ | |
matplotlib \ | |
mimalloc \ | |
ninja \ | |
numpy \ | |
ruamel.yaml | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.architecture }} | |
toolset: ${{ matrix.vs.msvc_toolset }} | |
- name: "install hpx" | |
uses: ./lue_source/.github/actions/install_hpx | |
with: | |
cache_key: ${{ matrix.os }}_${{ matrix.compiler.cxx }}-${{ matrix.vs.msvc_toolset }}_python-${{ matrix.python_version }}_hpx-${{ env.hpx_version }} | |
c_compiler: ${{ matrix.compiler.c }} | |
cxx_compiler: ${{ matrix.compiler.cxx }} | |
build_type: Release | |
cmake_preset: hpx_release_windows_node_configuration | |
cmake_preset_file: ${{ env.lue_source_directory }}/CMakeHPXPresets.json | |
# Boost root is here: $CONDA_PREFIX/Library, but this results in a backslashes in a Windows path in the HPXConfig.cmake | |
# That is a bug in the HPX CMake scripts. Forward slashes should be used, e.g.: file(TO_CMAKE_PATH BOOST_ROOT HPX_BOOST_ROOT). | |
cmake_flags: "-D BOOST_ROOT=C:/Miniconda/envs/test/Library -D HWLOC_ROOT=$CONDA_PREFIX/Library -D HWLOC_LIBRARY=$CONDA_PREFIX/Library/lib/hwloc.lib" | |
hpx_version: ${{ env.hpx_version }} | |
source_directory: ${{ env.hpx_source_directory }} | |
build_directory: ${{ env.hpx_build_directory }} | |
install_directory: ${{ env.hpx_install_directory }} | |
- name: "install mdspan" | |
uses: ./lue_source/.github/actions/install_mdspan | |
with: | |
cxx_compiler: ${{ matrix.compiler.cxx }} | |
build_type: Release | |
mdspan_tag: 721efd8 # 20240305 | |
source_directory: ${{ env.mdspan_source_directory }} | |
build_directory: ${{ env.mdspan_build_directory }} | |
install_directory: ${{ env.mdspan_install_directory }} | |
- name: configure | |
run: | | |
# TODO Use the GDAL Conan package instead of the Conda package, once the GDAL | |
# Conan package actually works | |
# boost gdal hdf5 hwloc mimalloc | |
mkdir ${{ env.lue_build_directory }} | |
python ${{ env.lue_source_directory }}/environment/script/write_conan_profile.py \ | |
${{ matrix.compiler.cxx }} \ | |
${{ env.lue_source_directory }}/host_profile | |
python ${{ env.lue_source_directory }}/environment/script/write_conan_profile.py \ | |
${{ matrix.compiler.cxx }} \ | |
${{ env.lue_source_directory }}/build_profile | |
LUE_CONAN_PACKAGES="docopt.cpp glfw imgui nlohmann_json vulkan-headers vulkan-loader" \ | |
conan install ${{ env.lue_source_directory }} \ | |
--profile:host=${{ env.lue_source_directory }}/host_profile \ | |
--profile:build=${{ env.lue_source_directory }}/build_profile \ | |
--build=missing \ | |
--output-folder=${{ env.lue_build_directory }} | |
CMAKE_PREFIX_PATH=${{ env.lue_build_directory }} \ | |
cmake \ | |
-S ${{ env.lue_source_directory }} \ | |
-B ${{ env.lue_build_directory }} \ | |
--preset conan-release \ | |
-D CMAKE_POLICY_DEFAULT_CMP0144=NEW \ | |
-D LUE_BUILD_QA=TRUE \ | |
-D LUE_QA_WITH_PYTHON_API=TRUE \ | |
-D LUE_QA_WITH_TESTS=TRUE \ | |
-D LUE_QA_TEST_NR_LOCALITIES_PER_TEST=1 \ | |
-D LUE_QA_TEST_NR_THREADS_PER_LOCALITY=2 \ | |
-D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE \ | |
-D LUE_DATA_MODEL_WITH_UTILITIES=TRUE \ | |
-D LUE_FRAMEWORK_WITH_IMAGE_LAND=TRUE \ | |
-D LUE_FRAMEWORK_WITH_PYTHON_API=TRUE \ | |
-D HPX_ROOT=${{ env.hpx_install_directory }} \ | |
-D MDSPAN_ROOT=${{ env.mdspan_install_directory }} | |
- name: build | |
run: | | |
cmake --build ${{ env.lue_build_directory }} --target all | |
- name: install | |
run: | | |
cmake \ | |
--install ${{ env.lue_build_directory }} \ | |
--prefix ${{ env.lue_runtime_install_directory }} \ | |
--component lue_runtime \ | |
--strip | |
cmake \ | |
--install ${{ env.lue_build_directory }} \ | |
--prefix ${{ env.lue_development_install_directory }} \ | |
--component lue_development \ | |
--strip | |
- name: test | |
run: | | |
# Unit tests | |
ctest --test-dir ${{ env.lue_build_directory }} --output-on-failure | |
# TODO See gh598 | |
### # Tests of runtime targets | |
### # Add location of dependencies installed with Conan to the runtime environment | |
### ${{ env.lue_build_directory }}/conanrun.bat | |
### export PATH="${{ env.lue_runtime_install_directory }}/bin:$PATH" | |
### ${{ env.lue_runtime_install_directory }}/bin/lue_translate --version | |
### ${{ env.lue_runtime_install_directory }}/bin/lue_validate --version | |
### ${{ env.lue_runtime_install_directory }}/bin/lue_view --version || echo "TODO: Error executing lue_view!" | |
### # Add our package to the set of Conda packages | |
### conda-develop ${{ env.lue_runtime_install_directory }}/lib/python${{ matrix.python_version }} | |
### ${{ env.lue_runtime_install_directory }}/bin/lue_calculate --version | |
### ${{ env.lue_runtime_install_directory }}/bin/lue_scalability --version | |
### python -c "import lue, lue.data_model, lue.framework, lue.pcraster, lue.qa.scalability; print(lue.__version__)" | |
### dumpbin //imports ${{ env.lue_runtime_install_directory }}/bin/lue_view.exe | |
### # Test of imported CMake targets | |
### git clone https://github.com/computationalgeography/lue_consume.git ${{ env.lue_consume_source_directory }} | |
### cmake \ | |
### -S ${{ env.lue_consume_source_directory }} \ | |
### -B ${{ env.lue_consume_build_directory }} \ | |
### -G "Ninja" \ | |
### -D CMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \ | |
### -D CMAKE_BUILD_TYPE=Release \ | |
### -D CMAKE_POLICY_DEFAULT_CMP0144=NEW \ | |
### -D LUE_ROOT=${{ env.lue_development_install_directory }} \ | |
### -D HPX_ROOT=${{ env.hpx_install_directory }} \ | |
### -D MDSPAN_ROOT=${{ env.mdspan_install_directory }} | |
### cmake --build ${{ env.lue_consume_build_directory }} --target all | |
### ${{ env.lue_consume_build_directory }}/lue_consume_data_model | |
### ${{ env.lue_consume_build_directory }}/lue_consume_framework |