Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -33,16 +33,23 @@ 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
- os: windows-latest
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.
Expand All @@ -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: >
Expand All @@ -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'
Expand All @@ -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 }}
Expand Down