From ec76e7afff1007c116c3b9cf0866d85575e665bb Mon Sep 17 00:00:00 2001 From: Giulio Girardi Date: Sun, 5 Mar 2023 11:58:50 +0000 Subject: [PATCH] Add windows CI --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++---- CMakePresets.json | 47 +++++++++++++++++++++++++++++++------- 2 files changed, 80 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 585e2aa..79cadc8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ defaults: shell: bash -l -eo pipefail {0} jobs: - test: + test-unix: strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -27,11 +27,11 @@ jobs: environment-name: xeus-octave cache-downloads: true - name: Configure - run: cmake --preset conda-debug + run: cmake --preset conda-debug-unix - name: Build - run: cmake --build --preset conda-debug + run: cmake --build --preset conda-debug-unix - name: Install - run: cmake --install build/cmake/conda-debug + run: cmake --install build/cmake/conda-debug-unix - name: Test run: python -m pytest ./test -k 'not plot' - name: Plotly toolkit test @@ -42,6 +42,43 @@ jobs: sudo apt-get update && sudo apt-get install libgl1-mesa-dev xvfb xvfb-run python -m pytest ./test -k 'plot_notebook' + test-win: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest] + steps: + - uses: actions/checkout@v3 + - name: Install mamba + uses: mamba-org/provision-with-micromamba@v13 + with: + environment-file: environment-dev.yml + environment-name: xeus-octave + cache-downloads: true + - name: micromamba shell hook + shell: powershell + run: micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba + - name: Configure + shell: cmd + run: | + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate xeus-octave + cmake --preset conda-debug-win + - name: Build + shell: cmd + run: | + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate xeus-octave + cmake --build --preset conda-debug-win + - name: Install + shell: cmd + run: | + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate xeus-octave + cmake --install build\cmake\conda-debug-win + - name: Test + shell: cmd + run: | + call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate xeus-octave + pytest test + static-analysis: runs-on: "ubuntu-latest" steps: diff --git a/CMakePresets.json b/CMakePresets.json index 3a502fd..d8f45c9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,23 +1,25 @@ { - "version": 2, + "version": 4, "buildPresets": [ { - "configurePreset": "conda-debug", - "name": "conda-debug" + "configurePreset": "conda-debug-unix", + "name": "conda-debug-unix" + }, + { + "configurePreset": "conda-debug-win", + "name": "conda-debug-win" } ], "configurePresets": [ { "binaryDir": "${sourceDir}/build/cmake/${presetName}", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "ccache", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "CMAKE_INSTALL_PREFIX": "$env{CONDA_PREFIX}", "CMAKE_PREFIX_PATH": "$env{CONDA_PREFIX}" }, "description": "Dev base profile using conda libraries", "displayName": "Conda Dev", - "generator": "Unix Makefiles", "hidden": true, "name": "conda-dev", "warnings": { @@ -30,12 +32,41 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }, - "description": "A debug build using conda libraries", + "displayName": "Debug", + "hidden": true, + "name": "debug" + }, + { + "cacheVariables": { + "CMAKE_CXX_COMPILER_LAUNCHER": "ccache" + }, + "condition": { + "lhs": "${hostSystemName}", + "rhs": "Windows", + "type": "notEquals" + }, + "description": "A debug build using conda libraries for Linux/MacOS", "displayName": "Conda Debug", + "generator": "Unix Makefiles", + "inherits": [ + "conda-dev", + "debug" + ], + "name": "conda-debug-unix" + }, + { + "condition": { + "lhs": "${hostSystemName}", + "rhs": "Windows", + "type": "equals" + }, + "description": "A debug build using conda libraries for Windows", + "generator": "NMake Makefiles", "inherits": [ - "conda-dev" + "conda-dev", + "debug" ], - "name": "conda-debug" + "name": "conda-debug-win" } ] }