From 83f8d97bd897572ebdc5538a412332506ebfaead Mon Sep 17 00:00:00 2001 From: Julien Lamy Date: Sun, 14 Apr 2024 17:47:41 +0200 Subject: [PATCH] Add Windows CI --- .ci/build/build.py | 7 +++++-- .ci/build/conda.py | 3 ++- .github/workflows/build.yml | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.ci/build/build.py b/.ci/build/build.py index 04ea53c..e3ea793 100644 --- a/.ci/build/build.py +++ b/.ci/build/build.py @@ -15,11 +15,14 @@ subprocess.check_call( [ "cmake", - "-G", "Ninja", "-DPython_EXECUTABLE={}".format(sys.executable), "-DCMAKE_INSTALL_PREFIX={}".format(install_dir), *([os.environ["CMAKE_OPTIONS"]] if "CMAKE_OPTIONS" in os.environ else []), workspace], cwd=build_dir) -subprocess.check_call(["ninja", "install"], cwd=build_dir) +subprocess.check_call( + [ + "cmake", "--build", ".", "--target", "install", "--config", "Release", + "--parallel"], + cwd=build_dir) diff --git a/.ci/build/conda.py b/.ci/build/conda.py index 6bf5d62..a8548fa 100644 --- a/.ci/build/conda.py +++ b/.ci/build/conda.py @@ -1,7 +1,8 @@ +import os import subprocess import sys -conda = sys.argv[1] if len(sys.argv) >= 2 else "conda" +conda = sys.argv[1] if len(sys.argv) >= 2 else os.environ.get("MAMBA_EXE", "conda") subprocess.check_call([ conda, "install", "--yes", "-c", "conda-forge", diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6735d62..c35525e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ jobs: - { os: "ubuntu-latest", container: "ubuntu:jammy", packaging: "apt", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python3" } - { os: "ubuntu-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" } - { os: "macos-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" } + - { os: "windows-latest", packaging: "conda", cmake_options: "-DCMAKE_CXX_STANDARD=17", python: "python" } env: WORKSPACE: "${{ github.workspace }}" CMAKE_OPTIONS: "${{ matrix.cmake_options }}" @@ -35,7 +36,7 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: init-shell: bash powershell - environment-name: dicomifier + environment-name: odil create-args: python=3.11 if: ${{ contains(matrix.packaging, 'conda') }}