diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8db7d4..0a72b5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] build_type: [Release] c_compiler: [gcc, clang, cl] include: @@ -33,6 +33,9 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ + - os: macos-latest + c_compiler: clang + cpp_compiler: clang++ exclude: - os: windows-latest c_compiler: gcc @@ -40,9 +43,13 @@ jobs: c_compiler: clang - os: ubuntu-latest c_compiler: cl + - os: macos-latest + c_compiler: cl + - os: macos-latest + c_compiler: gcc steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. @@ -52,7 +59,7 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Configure CMake (Linux) - if: matrix.os != 'windows-latest' + if: matrix.os == 'ubuntu-latest' # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: > @@ -63,6 +70,16 @@ jobs: -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC_TOOL=ON -S ${{ github.workspace }} + + - name: Configure CMake (macOS) + if: matrix.os == 'macos-latest' + run: | + cmake -B ${{ steps.strings.outputs.build-output-dir }} \ + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DBUILD_STATIC_TOOL=OFF \ + -S ${{ github.workspace }} - name: Configure CMake (Windows) if: matrix.os == 'windows-latest' @@ -88,7 +105,7 @@ jobs: run: ctest --build-config ${{ matrix.build_type }} - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: zarchive-build-${{matrix.os}}-${{matrix.build_type}}-${{matrix.c_compiler}} path: ${{ steps.strings.outputs.build-output-dir }}