From 9d4c7a948f5d46dd76d249c87030a5e69e3ef0fa Mon Sep 17 00:00:00 2001 From: tbeu Date: Wed, 7 Feb 2024 21:29:03 +0100 Subject: [PATCH] Build with CMake via GitHub Actions [ci skip] --- .github/workflows/cmake.yml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..3327b083 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,54 @@ +name: "Build with CMake" + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + name: ${{ matrix.toolchain }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + toolchain: + - linux-gcc + - macos-clang + - windows-msvc + configuration: + - Release + include: + - toolchain: linux-gcc + os: ubuntu-latest + compiler: gcc + - toolchain: macos-clang + os: macos-latest + compiler: clang + - toolchain: windows-msvc + os: windows-latest + compiler: msvc + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 5 + - name: Setup python environment + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install python packages + run: | + pip install --disable-pip-version-check --user "conan>=1.60.2,<2" + - name: Build libraries with ${{ matrix.compiler }} + run: | + if [ "${{ matrix.compiler }}" == "msvc" ]; then + cmake -S . -B build + cmake --build build --config ${{ matrix.configuration }} -DMATIO_USE_CONAN=ON + elif [ "${{ matrix.compiler }}" == "mingw" ]; then + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DMATIO_USE_CONAN=ON -G "MinGW Makefiles" + cmake --build build + else + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DMATIO_USE_CONAN=ON -DCMAKE_C_FLAGS="-std=c89 -Wall -Wextra" + cmake --build build + fi