From 75723a24f6e63a01862e01d56bf2a975ea9e3347 Mon Sep 17 00:00:00 2001 From: KRM7 <70973547+KRM7@users.noreply.github.com> Date: Mon, 25 Dec 2023 14:24:30 +0100 Subject: [PATCH] Create macos.yml --- .github/workflows/macos.yml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..5ad38d27 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,56 @@ +name: macos + +on: [push, pull_request] + +jobs: + build: + runs-on: macos-13 + strategy: + fail-fast: false + matrix: + build-type: [ Release, RelWithDebInfo ] + compiler: [ + { cxx: g++-11, pkgs: gcc@11, extra-flags: "-undefined dynamic_lookup" }, + { cxx: g++-12, pkgs: gcc@12, extra-flags: "-undefined dynamic_lookup" }, + { cxx: g++-13, pkgs: gcc@13, extra-flags: "-undefined dynamic_lookup" }, + { + cxx: $(brew --prefix llvm@14)/bin/clang++, + pkgs: llvm@14 gcc@11, + extra-flags: "-femulated-tls -stdlib=libstdc++ -stdlib++-isystem $(brew --prefix gcc@11)/include/c++/11 -cxx-isystem $(brew --prefix gcc@11)/include/c++/11/x86_64-apple-darwin22", + linker-flags: "-L$(brew --prefix gcc@11)/lib/gcc/11" + }, + { + cxx: $(brew --prefix llvm@15)/bin/clang++, + pkgs: llvm@15 gcc@12, + extra-flags: "-femulated-tls -stdlib=libstdc++ -stdlib++-isystem $(brew --prefix gcc@12)/include/c++/12 -cxx-isystem $(brew --prefix gcc@12)/include/c++/12/x86_64-apple-darwin22", + linker-flags: "-L$(brew --prefix gcc@12)/lib/gcc/12" + } + ] + + defaults: + run: + working-directory: ${{ github.workspace }}/build + + name: ${{ matrix.compiler.cxx }}, ${{ matrix.build-type }} + + steps: + - name: checkout-repo + uses: actions/checkout@v3 + + - name: setup-compiler + run: brew update && brew install ${{ matrix.compiler.pkgs }} + + - name: setup-catch + run: sudo bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}" + + - name: setup-build + run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}" -DGAPP_USE_LTO=OFF + + - name: build + run: cmake --build . --parallel 8 + + - name: run-tests + run: ctest --output-on-failure --schedule-random + + - name: install + run: sudo cmake --install . \ No newline at end of file