Skip to content

raw pointer

raw pointer #31

name: "MacOS"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: false
jobs:
build-and-test:
name: arm64-osx
runs-on: macos-26
env:
DEBUG_BUILD_DIR: ${{github.workspace}}/out/build/arm64-osx/Debug
RELEASE_BUILD_DIR: ${{github.workspace}}/out/build/arm64-osx/Release
INSTALL_DIR: ${{github.workspace}}/out/install
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install development environment
run: brew install automake autoconf autoconf-archive libtool
- name: Get vcpkg commit id
working-directory: vcpkg
run: git rev-parse HEAD >commit.txt
- name: Install vcpkg
working-directory: vcpkg
run: ./bootstrap-vcpkg.sh
- name: Create vcpkg cache
working-directory: vcpkg
run: mkdir binary-sources
- name: Restore vcpkg binary-cache
id: restore-vcpkg-cache
uses: actions/cache/restore@v4
with:
path: vcpkg/binary-sources/**/*.zip
key: vcpkg-cache-arm64-osx-${{hashFiles('vcpkg.json', 'vcpkg/commit.txt')}}-1
# MacOS installation has a bug where it doesn't set CMAKE_MAKE_PROGRAM
# even though CMake does find ninja during startup.
- name: CMake - Configure
run: cmake -D "CMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja" --preset=arm64-osx .
- name: Save vcpkg binary-cache
uses: actions/cache/save@v4
id: save-vcpkg-cache
if: always() && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
with:
path: vcpkg/binary-sources/**/*.zip
key: ${{steps.restore-vcpkg-cache.outputs.cache-primary-key}}
- name: CMake - Build (Debug)
run: cmake --build --preset=arm64-osx-dbg --parallel 1 .
- name: CMake - Build (Release)
run: cmake --build --preset=arm64-osx-rel --parallel 1 .
- name: Run tests (Debug)
working-directory: ${{env.DEBUG_BUILD_DIR}}
run: ./hktests-dbg --gtest_output=xml:hktests-dbg.xml
- name: Run tests (Release)
working-directory: ${{env.RELEASE_BUILD_DIR}}
run: ./hktests-rel --gtest_output=xml:hktests-rel.xml