From e902a42bc9f141ce86cda332132ed3b27dd29bb0 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Fri, 29 Nov 2024 16:10:52 +0000 Subject: [PATCH] ci: Add workflow to build against system 3rdparty (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: Add workflow to build against system 3rdparty This is mostly about fmt/spdlog being a fast moving target breaking source-compat as they go along. Added homebrew only, which has the latest versions, so is enough for good coverage. Created separate .yml file as the main one is getting complex. * Update .github/workflows/build-external.yml Co-authored-by: Miłosz Kosobucki --------- Co-authored-by: Miłosz Kosobucki --- .github/workflows/build-external.yml | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build-external.yml diff --git a/.github/workflows/build-external.yml b/.github/workflows/build-external.yml new file mode 100644 index 0000000..c75af64 --- /dev/null +++ b/.github/workflows/build-external.yml @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company +# +# SPDX-License-Identifier: MIT + +# Test on macOS with some dependencies provided externally by Homebrew. +# Both to validate the CMake setup for using system dependencies and to have early warning +# about incompatible changes in some fast-moving external libraries. +name: Build against external 3rdparty + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: + - macos-latest + shared: + - ON + - OFF + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + brew tap KDAB/tap + brew install fmt spdlog KDBindings + + - name: Configure project + run: > + cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -G Ninja + -DKDUTILS_BUILD_TESTS=ON + -DBUILD_SHARED_LIBS=${{ matrix.shared }} + + - name: Check if external dependencies were used + run: | + ! grep -q "KDBindings_DIR-NOTFOUND" ./build/CMakeCache.txt + ! grep -q "spdlog_DIR-NOTFOUND" ./build/CMakeCache.txt + ! grep -q "fmt_DIR-NOTFOUND" ./build/CMakeCache.txt + + - name: Build Project + run: cmake --build ./build + + - name: Run tests + run: ctest --test-dir ./build --output-on-failure