CI: Add a macOS Github runner (#2064)

This commit is contained in:
Tyler Wilding
2022-12-22 18:12:59 -05:00
committed by GitHub
parent 73561f10a3
commit 216e73b61f
22 changed files with 122 additions and 21 deletions
+8
View File
@@ -42,3 +42,11 @@ jobs:
cmakePreset: "Release-linux-gcc"
cachePrefix: ""
secrets: inherit
# MacOS
build_macos_clang:
name: "🍎 MacOS"
uses: ./.github/workflows/macos-build-clang.yaml
with:
cmakePreset: "Release-macos-clang"
cachePrefix: ""
+1 -1
View File
@@ -50,7 +50,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache
- name: Build Project
run: cmake --build build -j$((`nproc`+1))
run: cmake --build build --parallel $((`nproc`))
- name: Run Tests
env:
+1 -1
View File
@@ -51,7 +51,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache
- name: Build Project
run: cmake --build build -j$((`nproc`+1)) -- -w dupbuild=warn
run: cmake --build build --parallel $((`nproc`)) -- -w dupbuild=warn
- name: Run Tests - With Coverage
working-directory: ./build
+76
View File
@@ -0,0 +1,76 @@
name: MacOS Build Clang
on:
workflow_call:
inputs:
cmakePreset:
required: true
type: string
cachePrefix:
required: true
type: string
jobs:
build:
name: Clang
runs-on: macos-12
timeout-minutes: 120
env: # overrides: https://github.com/mbitsnbites/buildcache/blob/master/doc/configuration.md
BUILDCACHE_MAX_CACHE_SIZE: 1000000000 # 1gb
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_COMPRESS_LEVEL: 19
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_LOG_FILE: ${{ github.workspace }}/buildcache.log
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Package Dependencies
run: brew install cmake nasm ninja
- name: Setup Buildcache
uses: mikehardy/buildcache-action@v2.1.0
with:
cache_key: macos-12-${{ inputs.cachePrefix }}-${{ inputs.cmakePreset }}
buildcache_tag: v0.28.1
- name: CMake Generation
env:
CC: clang
CXX: clang++
run: |
cmake -B build --preset=${{ inputs.cmakePreset }} \
-DCMAKE_C_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache
# Disabled for now, not all build targets are valid
# - name: Build Project
# run: cmake --build build --parallel $((`sysctl -n hw.logicalcpu`))
# Temporary, selectively build those that work
- name: Build Working Targets
run: |
cmake --build build --target extractor --parallel $((`sysctl -n hw.logicalcpu`)) && \
cmake --build build --target offline-test --parallel $((`sysctl -n hw.logicalcpu`)) && \
cmake --build build --target decompiler --parallel $((`sysctl -n hw.logicalcpu`)) && \
cmake --build build --target lsp --parallel $((`sysctl -n hw.logicalcpu`)) && \
cmake --build build --target goalc --parallel $((`sysctl -n hw.logicalcpu`))
- name: Run Tests
continue-on-error: true # until macOS is stable
env:
GTEST_OUTPUT: "xml:opengoal-test-report.xml"
run: ./test.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: opengoal-macos-${{ inputs.cachePrefix }}
if-no-files-found: error
path: |
./build/goalc/goalc
./build/decompiler/extractor
./build/game/gk
./build/lsp/lsp
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
- name: Build Project
shell: cmd
run: cmake --build build -j 2
run: cmake --build build --parallel %NUMBER_OF_PROCESSORS%
- name: Run Tests
timeout-minutes: 10
+1 -1
View File
@@ -45,7 +45,7 @@ jobs:
shell: cmd
run: |
set CL=/MP
cmake --build build -j 2
cmake --build build --parallel %NUMBER_OF_PROCESSORS%
- name: Run Tests
timeout-minutes: 10