From fd9c5c89d516689aea6c5273b22c012370329117 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 26 Jul 2023 15:51:12 +0200 Subject: [PATCH] Run CI on windows --- .github/workflows/python-tests.yml | 10 ++++------ .github/workflows/rust-tests.yml | 8 ++++++++ python/rascaline/rascaline/_c_lib.py | 7 +++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 868a74de3..81c8b6d75 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -19,13 +19,12 @@ jobs: matrix: include: - os: ubuntu-20.04 - rust-target: x86_64-unknown-linux-gnu python-version: "3.7" - os: ubuntu-20.04 - rust-target: x86_64-unknown-linux-gnu python-version: "3.11" - os: macos-11 - rust-target: x86_64-apple-darwin + python-version: "3.11" + - os: windows-2019 python-version: "3.11" steps: - uses: actions/checkout@v3 @@ -39,13 +38,12 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - target: ${{ matrix.rust-target }} - name: install python dependencies run: | python -m pip install --upgrade pip python -m pip install tox - echo "tox_version=$(tox --version | awk '{split($0, s," "); print s[1]}')" >> $GITHUB_ENV + echo "tox_version=$(python -c 'import tox; print(tox.__version__)')" >> $GITHUB_ENV - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.3 @@ -92,7 +90,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install tox - echo "tox_version=$(tox --version | awk '{split($0, s," "); print s[1]}')" >> $GITHUB_ENV + echo "tox_version=$(python -c 'import tox; print(tox.__version__)')" >> $GITHUB_ENV - name: cache tox environments uses: actions/cache@v3 diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 81cc57f8c..8a614d12a 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -24,6 +24,7 @@ jobs: build-type: debug test-static-lib: true extra-name: / static C library + - os: ubuntu-20.04 rust-version: stable rust-target: x86_64-unknown-linux-gnu @@ -31,6 +32,7 @@ jobs: cargo-build-flags: --release do-valgrind: true extra-name: / release valgrind + # check the build on a stock Ubuntu 20.04, including cmake 3.16 - os: ubuntu-20.04 rust-version: "1.63" @@ -38,10 +40,16 @@ jobs: rust-target: x86_64-unknown-linux-gnu build-type: debug extra-name: / cmake 3.16 + - os: macos-11 rust-version: stable rust-target: x86_64-apple-darwin build-type: debug + + - os: windows-2019 + rust-version: stable + rust-target: x86_64-pc-windows-msvc + build-type: debug steps: - name: install dependencies in container if: matrix.container == 'ubuntu:20.04' diff --git a/python/rascaline/rascaline/_c_lib.py b/python/rascaline/rascaline/_c_lib.py index df19dfe51..7c17a2416 100644 --- a/python/rascaline/rascaline/_c_lib.py +++ b/python/rascaline/rascaline/_c_lib.py @@ -32,17 +32,16 @@ def __call__(self): def _lib_path(): if sys.platform.startswith("darwin"): windows = False - name = "librascaline.dylib" + path = os.path.join(_HERE, "lib", "librascaline.dylib") elif sys.platform.startswith("linux"): windows = False - name = "librascaline.so" + path = os.path.join(_HERE, "lib", "librascaline.so") elif sys.platform.startswith("win"): windows = True - name = "rascaline.dll" + path = os.path.join(_HERE, "bin", "rascaline.dll") else: raise ImportError("Unknown platform. Please edit this file") - path = os.path.join(os.path.join(_HERE, "lib"), name) if os.path.isfile(path): if windows: _check_dll(path)