rename to hikoworks #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 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 | |
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 | |