From 61ed12c4f2a752b41ebf5e1f295e784a38681b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Mon, 11 Apr 2022 09:30:54 +0200 Subject: [PATCH] Merge cmake.yml into CITest.yml --- .github/workflows/CITest.yml | 60 +++++++++++++++++++----------------- .github/workflows/cmake.yml | 41 ------------------------ CMakePresets.json | 36 ++++++++++++++++++++++ 3 files changed, 67 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/CITest.yml b/.github/workflows/CITest.yml index 4c830ce76..de92c8dfb 100644 --- a/.github/workflows/CITest.yml +++ b/.github/workflows/CITest.yml @@ -118,35 +118,37 @@ jobs: python cstest_report.py -D -t build/cstest -d ../MC; python cstest_report.py -D -t build/cstest -f issues.cs; cd ..; - # Windows: - # runs-on: ${{ matrix.config.os }} - # name: ${{ matrix.config.name }} - # strategy: - # fail-fast: false - # matrix: - # config: - # - { - # name: 'windows x64 MSVC 64bit', - # os: windows-latest, - # arch: x64, - # python-arch: x64, - # python-version: '3.9', - # } + Windows: + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.name }} + strategy: + fail-fast: false + matrix: + config: + - name: 'windows x64 MSVC 64bit' + os: windows-latest + arch: x64 + platform: windows + python-arch: x64 + python-version: '3.9' - # steps: - # - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v3 - # - name: '🛠️ Win MSVC 64 setup' - # if: contains(matrix.config.name, 'MSVC 64') - # uses: microsoft/setup-msbuild@v1 + - uses: lukka/get-cmake@latest + name: Get CMake - # - name: '🚧 Win MSVC 64 build' - # if: contains(matrix.config.name, 'MSVC 64') - # shell: bash - # run: | - # # choco install cmake - # cmake --version - # mkdir build - # cd build - # cmake .. - # cmake --build . --config Release --target install + - name: '🛠️ Win MSVC 64 setup' + if: contains(matrix.config.name, 'MSVC 64') + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: 'x64' + + - name: '🚧 Win MSVC 64 build' + if: contains(matrix.config.name, 'MSVC 64') + shell: bash + run: | + cmake --version + cmake --preset=${{ matrix.config.platform }}-x64 + cmake --build --preset build-${{ matrix.config.platform }}-release + cmake --build --preset install-${{ matrix.config.platform }}-release diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index 419657202..000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CMake - -on: push - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - macOS-latest - - ubuntu-20.04 - - windows-2022 - include: - - os: windows-2022 - platform: windows - - os: ubuntu-20.04 - platform: linux - - os: macOS-latest - platform: macos - - steps: - - - uses: actions/checkout@v3 - - - uses: lukka/get-cmake@latest - name: Get CMake - - - uses: ilammy/msvc-dev-cmd@v1 - name: Setup Windows dev environment - with: - arch: 'x64' - if: ${{ matrix.platform == 'windows' }} - - - name: 'Configure, Build and Install' - run: | - cmake --preset=${{ matrix.platform }}-x64 - cmake --build --preset build-${{ matrix.platform }} - cmake --build --preset install-${{ matrix.platform }} diff --git a/CMakePresets.json b/CMakePresets.json index ade6f2bc6..ad7942ac0 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -72,6 +72,24 @@ "nativeToolOptions": [ "-v" ], "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} }, + { + "name": "build-linux-release", + "inherits": "build-linux", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux"} + }, + { + "name": "build-macos-release", + "inherits": "build-macos", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin"} + }, + { + "name": "build-windows-release", + "inherits": "build-windows", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, { "name": "install-linux", "configurePreset": "linux-x64", @@ -92,6 +110,24 @@ "inherits": "build-windows", "targets": [ "install" ], "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, + { + "name": "install-linux-release", + "inherits": "install-linux", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux"} + }, + { + "name": "install-macos-release", + "inherits": "install-macos", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin"} + }, + { + "name": "install-windows-release", + "inherits": "install-windows", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} } ] }