From c50f9c3b4c82bce5bfa3a442933d34c73bb204e2 Mon Sep 17 00:00:00 2001 From: Alonso Schaich Date: Sun, 18 Feb 2024 18:52:56 +0000 Subject: [PATCH] Add more ci targets (#8) Fixes #7 --- .github/workflows/cmake.yml | 17 +++--- CMakeLists.txt | 3 +- CMakePresets.json | 109 +++++++++++++++++++++++++++++------- 3 files changed, 101 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 70747cb..bfbbe7c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -8,10 +8,13 @@ on: jobs: build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + runner: ['ubuntu-22.04', 'windows-2022'] + build_type: ['debug', 'release'] + + runs-on: ${{ matrix.runner }} steps: - name: Checkout Repository @@ -26,13 +29,13 @@ jobs: - name: Configure working-directory: ${{github.workspace}} - run: cmake --preset ci-x64-windows-vs2022-release + run: cmake --preset gh-${{matrix.runner}}-${{matrix.build_type}} - name: Build working-directory: ${{github.workspace}} - run: cmake --build --preset ci-x64-windows-vs2022-release + run: cmake --build --preset gh-${{matrix.runner}}-${{matrix.build_type}} - name: Test working-directory: ${{github.workspace}} - run: ctest --preset ci-x64-windows-vs2022-release + run: ctest --preset gh-${{matrix.runner}}-${{matrix.build_type}} diff --git a/CMakeLists.txt b/CMakeLists.txt index a2157f0..7709dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,10 @@ project(VcpkgSQLiteIntegrationDemo CXX) enable_testing() find_package(SQLite3 REQUIRED) +find_package(Threads REQUIRED) add_executable(vcpkg-sqlite-demo demo.cpp) -target_link_libraries(vcpkg-sqlite-demo PUBLIC SQLite::SQLite3) +target_link_libraries(vcpkg-sqlite-demo PUBLIC SQLite::SQLite3 Threads::Threads) add_test(NAME vcpkg-sqlite-demo COMMAND vcpkg-sqlite-demo COMMAND_EXPAND_LISTS) set_property(TEST vcpkg-sqlite-demo PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin") diff --git a/CMakePresets.json b/CMakePresets.json index 9e1c786..d66150f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -203,22 +203,47 @@ "hidden": true }, + + { + "name": "gh-ubuntu-22.04-debug", + "description": "For github hosted `ubuntu-22.04` runner", + "inherits": [ "ci-base", "make", "x64-linux", "debug" ] + }, + { + "name": "gh-ubuntu-22.04-release", + "description": "For github hosted `ubuntu-22.04` runner", + "inherits": [ "ci-base", "make", "x64-linux", "release" ] + }, { - "name": "gh-ubuntu22.04-llvm14-debug", + "name": "gh-ubuntu-22.04-llvm14-debug", + "description": "For github hosted `ubuntu-22.04` runner", "inherits": [ "ci-base", "make", "x64-linux", "llvm-14", "debug", "coverage" ] }, { - "name": "gh-ubuntu22.04-llvm14-release", + "name": "gh-ubuntu-22.04-llvm14-release", + "description": "For github hosted `ubuntu-22.04` runner", "inherits": [ "ci-base", "make", "x64-linux", "llvm-14", "release" ] }, { - "name": "gh-ubuntu22.04-llvm15-debug", + "name": "gh-ubuntu-22.04-llvm15-debug", + "description": "For github hosted `ubuntu-22.04` runner", "inherits": [ "ci-base", "make", "x64-linux", "llvm-15", "debug", "coverage" ] }, { - "name": "gh-ubuntu22.04-llvm15-release", + "name": "gh-ubuntu-22.04-llvm15-release", + "description": "For github hosted `ubuntu-22.04` runner", "inherits": [ "ci-base", "make", "x64-linux", "llvm-15", "release" ] }, + { + "name": "gh-windows-2022-debug", + "description": "For github hosted `windows-2022` runner", + "inherits": [ "ci-base", "vs2022", "x64-windows", "debug" ] + }, + { + "name": "gh-windows-2022-release", + "description": "For github hosted `windows-2022` runner", + "inherits": [ "ci-base", "vs2022", "x64-windows", "release" ] + }, { "name": "ci-x64-linux-debug", "inherits": [ "ci-base", "make", "x64-linux", "debug", "coverage" ] @@ -310,29 +335,53 @@ "hidden": true }, { - "name": "gh-ubuntu22.04-llvm14-debug", - "configurePreset": "gh-ubuntu22.04-llvm14-debug", + "name": "gh-ubuntu-22.04-debug", + "configurePreset": "gh-ubuntu-22.04-debug", + "configuration": "Debug", + "inherits": [ "linux" ] + }, + { + "name": "gh-ubuntu-22.04-release", + "configurePreset": "gh-ubuntu-22.04-release", + "configuration": "Release", + "inherits": [ "linux" ] + }, + { + "name": "gh-ubuntu-22.04-llvm14-debug", + "configurePreset": "gh-ubuntu-22.04-llvm14-debug", "configuration": "Debug", "inherits": [ "linux" ] }, { - "name": "gh-ubuntu22.04-llvm14-release", - "configurePreset": "gh-ubuntu22.04-llvm14-release", + "name": "gh-ubuntu-22.04-llvm14-release", + "configurePreset": "gh-ubuntu-22.04-llvm14-release", "configuration": "Release", "inherits": [ "linux" ] }, { - "name": "gh-ubuntu22.04-llvm15-debug", - "configurePreset": "gh-ubuntu22.04-llvm15-debug", + "name": "gh-ubuntu-22.04-llvm15-debug", + "configurePreset": "gh-ubuntu-22.04-llvm15-debug", "configuration": "Debug", "inherits": [ "linux" ] }, { - "name": "gh-ubuntu22.04-llvm15-release", - "configurePreset": "gh-ubuntu22.04-llvm15-release", + "name": "gh-ubuntu-22.04-llvm15-release", + "configurePreset": "gh-ubuntu-22.04-llvm15-release", "configuration": "Release", "inherits": [ "linux" ] }, + { + "name": "gh-windows-2022-debug", + "configurePreset": "gh-windows-2022-debug", + "configuration": "Debug", + "inherits": [ "windows" ] + }, + { + "name": "gh-windows-2022-release", + "configurePreset": "gh-windows-2022-release", + "configuration": "Release", + "inherits": [ "windows" ] + }, { "name": "ci-x64-freebsd-debug", "configurePreset": "ci-x64-freebsd-debug", @@ -451,25 +500,45 @@ "hidden": true }, { - "name": "gh-ubuntu22.04-llvm14-debug", - "configurePreset": "gh-ubuntu22.04-llvm14-debug", + "name": "gh-ubuntu-22.04-debug", + "configurePreset": "gh-ubuntu-22.04-debug", + "inherits": [ "ci", "linux", "debug" ] + }, + { + "name": "gh-ubuntu-22.04-release", + "configurePreset": "gh-ubuntu-22.04-release", + "inherits": [ "ci", "linux", "release" ] + }, + { + "name": "gh-ubuntu-22.04-llvm14-debug", + "configurePreset": "gh-ubuntu-22.04-llvm14-debug", "inherits": [ "ci", "linux", "debug" ] }, { - "name": "gh-ubuntu22.04-llvm14-release", - "configurePreset": "gh-ubuntu22.04-llvm14-release", + "name": "gh-ubuntu-22.04-llvm14-release", + "configurePreset": "gh-ubuntu-22.04-llvm14-release", "inherits": [ "ci", "linux", "release" ] }, { - "name": "gh-ubuntu22.04-llvm15-debug", - "configurePreset": "gh-ubuntu22.04-llvm15-debug", + "name": "gh-ubuntu-22.04-llvm15-debug", + "configurePreset": "gh-ubuntu-22.04-llvm15-debug", "inherits": [ "ci", "linux", "debug" ] }, { - "name": "gh-ubuntu22.04-llvm15-release", - "configurePreset": "gh-ubuntu22.04-llvm15-release", + "name": "gh-ubuntu-22.04-llvm15-release", + "configurePreset": "gh-ubuntu-22.04-llvm15-release", "inherits": [ "ci", "linux", "release" ] }, + { + "name": "gh-windows-2022-debug", + "configurePreset": "gh-windows-2022-debug", + "inherits": [ "ci", "windows", "debug" ] + }, + { + "name": "gh-windows-2022-release", + "configurePreset": "gh-windows-2022-release", + "inherits": [ "ci", "windows", "release" ] + }, { "name": "ci-x64-freebsd-debug", "configurePreset": "ci-x64-freebsd-debug",