From fe538735f35952056826db0ccfbef5802c232b78 Mon Sep 17 00:00:00 2001 From: craftablescience Date: Sat, 9 Nov 2024 11:31:27 -0500 Subject: [PATCH] fix(ci): compile on a virtual machine for macOS because why not at this point --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f965d101..0428ac3f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,12 +8,12 @@ on: # nothing here jobs: - build: + build-regular: strategy: fail-fast: false matrix: build_type: [Debug, Release] - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest] runs-on: ${{matrix.os}} steps: - name: Checkout Repository @@ -28,25 +28,42 @@ jobs: arch: x64 spectre: true - - name: Install Dependencies [macOS] - if: matrix.os == 'macos-latest' - run: | - brew install gcc@14 - brew install ninja - - name: Install Dependencies [Linux] if: matrix.os == 'ubuntu-latest' run: sudo apt update && sudo apt install -y ninja-build - - name: Configure CMake [Windows / Linux] - if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest' + - name: Configure CMake run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSOURCEPP_BUILD_TESTS=ON - - name: Configure CMake [macOS] - if: matrix.os == 'macos-latest' + - name: Build + run: cmake --build build --config ${{matrix.build_type}} + + - name: Test + working-directory: '${{github.workspace}}/build' + run: ctest + + build-macos: + strategy: + matrix: + build_type: [Debug, Release] + runs-on: ubuntu-latest + container: ghcr.io/shepherdjerred/macos-cross-compiler:latest@sha256:493c4f2beced5b635a0e2a73d5fd1aba77135cf0fa895a28c286c3b1df722b92 + defaults: + run: + shell: bash + steps: + - name: Install Programs + run: | + apt update && apt install -y git cmake curl ninja-build python3 + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Configure CMake run: | - export PATH=/opt/homebrew/bin:$PATH - cmake -G "Ninja" -B build -DCMAKE_C_COMPILER="gcc-14" -DCMAKE_CXX_COMPILER="g++-14" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSOURCEPP_BUILD_TESTS=ON + cmake -G "Ninja" -B build -DCMAKE_C_COMPILER="aarch64-apple-darwin22-gcc" -DCMAKE_CXX_COMPILER="aarch64-apple-darwin22-g++" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSOURCEPP_BUILD_TESTS=ON - name: Build run: cmake --build build --config ${{matrix.build_type}}