mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
77 lines
2.5 KiB
YAML
77 lines
2.5 KiB
YAML
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
|