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
+1
View File
@@ -98,6 +98,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message(STATUS "AppleClang detected - Setting Defaults")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} \
-march=native \
-Wall \
-Winit-self \
-ggdb \
+16
View File
@@ -57,6 +57,16 @@
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}"
}
},
{
"name": "base-macos-release",
"hidden": true,
"inherits": "base",
"binaryDir": "${sourceDir}/build/Release/bin",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}"
}
},
{
"name": "base-clang",
"hidden": true,
@@ -127,6 +137,12 @@
"description": "Build with Clang as Release without Debug Symbols",
"inherits": ["base-linux-release", "base-clang"]
},
{
"name": "Release-macos-clang",
"displayName": "MacOS Release (clang)",
"description": "Build with Clang as Release without Debug Symbols",
"inherits": ["base-macos-release", "base-clang"]
},
{
"name": "Release-linux-clang-asan",
"displayName": "Linux Release (clang-asan)",
+1 -1
View File
@@ -4,7 +4,7 @@
<p align="center">
<a href="https://opengoal.dev/docs/intro" rel="nofollow"><img src="https://img.shields.io/badge/Documentation-Here-informational" alt="Documentation Badge" style="max-width:100%;"></a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/open-goal/jak-project/workflows/Build/badge.svg"><img src="https://github.com/open-goal/jak-project/workflows/Build/badge.svg" alt="Linux and Windows Build" style="max-width:100%;"></a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/open-goal/jak-project/actions/workflows/build-matrix.yaml"><img src="https://github.com/open-goal/jak-project/actions/workflows/build-matrix.yaml/badge.svg" alt="Linux and Windows Build" style="max-width:100%;"></a>
<a href="https://www.codacy.com/gh/open-goal/jak-project/dashboard?utm_source=github.com&utm_medium=referral&utm_content=open-goal/jak-project&utm_campaign=Badge_Coverage" rel="nofollow"><img src="https://app.codacy.com/project/badge/Coverage/29316d04a1644aa390c33be07289f3f5" alt="Codacy Badge" style="max-width:100%;"></a>
<a href="https://www.codacy.com/gh/open-goal/jak-project/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=open-goal/jak-project&amp;utm_campaign=Badge_Grade" rel="nofollow"><img src="https://app.codacy.com/project/badge/Grade/29316d04a1644aa390c33be07289f3f5" alt="Codacy Badge" style="max-width:100%;"></a>
<a href="https://discord.gg/VZbXMHXzWv"><img src="https://img.shields.io/discord/756287461377703987" alt="Discord"></a>
+1 -1
View File
@@ -9,9 +9,9 @@
#include "ParseHelpers.h"
#include "common/log/log.h"
#include "common/util/FileUtil.h"
#include "common/util/unicode_util.h"
#include <common/log/log.h>
#include "third-party/fmt/core.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include "ReplServer.h"
#include "common/cross_sockets/XSocket.h"
#include <common/versions.h>
#include "common/versions.h"
#include "third-party/fmt/core.h"
+2 -2
View File
@@ -2,7 +2,7 @@
#include <cstring>
#ifdef __APPLE__
#ifdef __arm__
#include <arm_acle.h>
u32 crc32(const u8* data, size_t size) {
u32 result = 0xffffffff;
@@ -39,4 +39,4 @@ u32 crc32(const u8* data, size_t size) {
}
return ~result;
}
#endif
#endif
+2 -2
View File
@@ -8,7 +8,7 @@
#include "common/util/FileUtil.h"
#include "common/util/json_util.h"
#include "common/util/read_iso_file.h"
#include <common/util/unicode_util.h>
#include "common/util/unicode_util.h"
#include "decompiler/Disasm/OpcodeInfo.h"
#include "decompiler/ObjectFile/ObjectFileDB.h"
@@ -71,7 +71,7 @@ std::tuple<std::optional<ISOMetadata>, ExtractorErrorCode> validate(
return {std::nullopt, ExtractorErrorCode::VALIDATION_ELF_MISSING_FROM_DB};
}
auto version_info = meta_entry->second;
auto& version_info = meta_entry->second;
// Print out some information
lg::info("Detected Game Metadata:");
lg::info("\tDetected - {}", version_info.canonical_name);
+1 -1
View File
@@ -9,8 +9,8 @@
#include "common/util/Timer.h"
#include "common/util/diff.h"
#include "common/util/os.h"
#include "common/util/unicode_util.h"
#include "common/versions.h"
#include <common/util/unicode_util.h>
#include "ObjectFile/ObjectFileDB.h"
#include "decompiler/data/TextureDB.h"
+1 -1
View File
@@ -1,8 +1,8 @@
#pragma once
#include "common/goos/Reader.h"
#include "common/goos/TextDB.h"
#include "common/type_system/TypeSystem.h"
#include <common/goos/TextDB.h>
#include "decompiler/Disasm/Register.h"
+1 -1
View File
@@ -12,8 +12,8 @@
#include "common/log/log.h"
#include "common/util/FileUtil.h"
#include "common/util/os.h"
#include "common/util/unicode_util.h"
#include "common/versions.h"
#include <common/util/unicode_util.h>
#include "game/discord.h"
+2 -2
View File
@@ -9,8 +9,8 @@
#include "common/cross_sockets/XSocket.h"
#include "common/versions.h"
#include <common/listener_common.h>
#include <common/util/Assert.h>
#include "common/listener_common.h"
#include "common/util/Assert.h"
#include "third-party/fmt/core.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include <cstring>
#include "common/util/Assert.h"
#include <common/util/FileUtil.h>
#include "common/util/FileUtil.h"
#include "game/sce/iop.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "common/log/log.h"
#include "common/util/FileUtil.h"
#include "common/util/os.h"
#include <common/util/unicode_util.h>
#include "common/util/unicode_util.h"
#include "gtest/gtest.h"
+1 -1
View File
@@ -2,8 +2,8 @@
#include "common/util/BinaryWriter.h"
#include "common/util/FileUtil.h"
#include "common/util/unicode_util.h"
#include "common/versions.h"
#include <common/util/unicode_util.h>
#include "third-party/json.hpp"
+1 -1
View File
@@ -3,8 +3,8 @@
#include "common/util/DgoReader.h"
#include "common/util/FileUtil.h"
#include "common/util/unicode_util.h"
#include "common/versions.h"
#include <common/util/unicode_util.h>
namespace {
int run(int argc, char** argv) {
+1 -1
View File
@@ -1,7 +1,7 @@
#include "common/util/Assert.h"
#include "common/util/DgoReader.h"
#include "common/util/FileUtil.h"
#include <common/util/unicode_util.h>
#include "common/util/unicode_util.h"
#include "decompiler/ObjectFile/LinkedObjectFile.h"
#include "decompiler/ObjectFile/LinkedObjectFileCreation.h"