From f92ee24fbc0a84287e42d29da59dd86809b12a02 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 6 Nov 2022 20:40:18 +0700 Subject: [PATCH] use cmake presets for CI --- .github/workflows/darwin.yml | 11 +++++---- .github/workflows/linux.yml | 5 +++- .github/workflows/windows.yml | 13 +++++++---- CMakePresets.json | 43 +++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 10 deletions(-) diff --git a/.github/workflows/darwin.yml b/.github/workflows/darwin.yml index 5d50da2..9164866 100644 --- a/.github/workflows/darwin.yml +++ b/.github/workflows/darwin.yml @@ -10,9 +10,9 @@ jobs: matrix: config: # https://github.com/actions/virtual-environments/tree/main/images/macos - - { os: "macos-11", xcode: "13.0" } - - { os: "macos-11", xcode: "13.1" } - - { os: "macos-11", xcode: "13.2" } + - { os: "macos-11", xcode: "13.0", arch: "x64" } + - { os: "macos-11", xcode: "13.1", arch: "x64" } + - { os: "macos-11", xcode: "13.2", arch: "x64" } name: "xcode-${{matrix.config.xcode}}" steps: - uses: actions/checkout@v2 @@ -21,4 +21,7 @@ jobs: - name: Select Xcode run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app" - name: Build && Test - run: .ci/build_darwin.sh + run: | + cmake --preset macos-${{matrix.config.arch}} + cmake --build --preset macos-${{matrix.config.arch}}-release + ctest --preset macos-${{matrix.config.arch}}-release \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b1296ea..696d813 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -21,5 +21,8 @@ jobs: with: submodules: recursive - name: Build && Test - run: .ci/build_linux.sh env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" } + run: | + cmake --preset linux-${{matrix.config.cc}} + cmake --build --preset linux-${{matrix.config.cc}}-release + ctest --preset linux-${{matrix.config.cc}}-release diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5d154bd..45d65c8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,14 +10,17 @@ jobs: matrix: config: # https://github.com/actions/virtual-environments/tree/main/images/win - - { os: "windows-2019", vs: "Visual Studio 2019", arch: "x86" } - - { os: "windows-2019", vs: "Visual Studio 2019", arch: "x64" } - - { os: "windows-2022", vs: "Visual Studio 2022", arch: "x86" } - - { os: "windows-2022", vs: "Visual Studio 2022", arch: "x64" } + - { os: "windows-2019", vs: "msvc2019", arch: "x86" } + - { os: "windows-2019", vs: "msvc2019", arch: "x64" } + - { os: "windows-2022", vs: "msvc2022", arch: "x86" } + - { os: "windows-2022", vs: "msvc2022", arch: "x64" } name: "${{matrix.config.vs}} ${{matrix.config.arch}}" steps: - uses: actions/checkout@v2 with: submodules: recursive - name: Build && Test - run: .ci\build_windows_${{matrix.config.arch}}.bat + run: | + cmake --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}} + cmake --build --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release + ctest --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release diff --git a/CMakePresets.json b/CMakePresets.json index d337037..64be4f6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -241,5 +241,48 @@ "configuration": "Release", "configurePreset": "windows-x64-msvc2022" } + ], + + "testPresets": [ + { + "name": "linux-gcc10-release", + "configuration": "Release", + "configurePreset": "linux-gcc10" + }, + { + "name": "linux-clang10-release", + "configuration": "Release", + "configurePreset": "linux-clang10" + }, + { + "name": "macos-arm64-release", + "configuration": "Release", + "configurePreset": "macos-arm64" + }, + { + "name": "macos-x64-release", + "configuration": "Release", + "configurePreset": "macos-x64" + }, + { + "name": "windows-x86-msvc2019-release", + "configuration": "Release", + "configurePreset": "windows-x86-msvc2019" + }, + { + "name": "windows-x64-msvc2019-release", + "configuration": "Release", + "configurePreset": "windows-x64-msvc2019" + }, + { + "name": "windows-x86-msvc2022-release", + "configuration": "Release", + "configurePreset": "windows-x86-msvc2022" + }, + { + "name": "windows-x64-msvc2022-release", + "configuration": "Release", + "configurePreset": "windows-x64-msvc2022" + } ] }