Skip to content

Commit

Permalink
Merge remote-tracking branch 'base/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dallmeyer committed Sep 1, 2024
2 parents a4128d8 + f9a5695 commit e9b01af
Show file tree
Hide file tree
Showing 65 changed files with 21,460 additions and 1,131 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,46 @@ name: Build
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
merge_group: {}

jobs:
# Windows
build_windows_clang:
name: "🖥️ Windows"
name: "🖥️ Windows (Clang)"
uses: ./.github/workflows/windows-build-clang.yaml
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
with:
cmakePreset: "Release-windows-clang"
cachePrefix: ""
secrets: inherit

build_windows_msvc:
name: "🖥️ Windows"
name: "🖥️ Windows (MSVC)"
uses: ./.github/workflows/windows-build-msvc.yaml
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
with:
cmakePreset: "Release-windows-msvc"
cachePrefix: ""
secrets: inherit

# Linux
build_linux_clang:
name: "🐧 Linux"
name: "🐧 Linux (Clang)"
uses: ./.github/workflows/linux-build-clang.yaml
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
with:
cmakePreset: "Release-linux-clang-asan"
cachePrefix: ""
secrets: inherit

build_linux_gcc:
name: "🐧 Linux"
name: "🐧 Linux (GCC)"
uses: ./.github/workflows/linux-build-gcc.yaml
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
with:
cmakePreset: "Release-linux-gcc"
cachePrefix: ""
Expand All @@ -48,11 +52,12 @@ jobs:
build_macos_intel:
name: "🍎 MacOS"
uses: ./.github/workflows/macos-build.yaml
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
with:
cmakePreset: "Release-macos-clang"
cachePrefix: ""

# Q4 2023 there will hopefully be native arm64 runners
# Q4 2023 there will hopefully be native arm64 runners
# https://github.com/github/roadmap/issues/528
# build_macos_arm:
# name: "🍎 MacOS"
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/compiler-output-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,9 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build goalc (master)
run: cmake --build build --parallel $((`nproc`)) --target goalc

- name: Compile and preserve (master)
run: |
./build/goalc/goalc --game jak1 --cmd "(make-group \"all-code\")"
./build/goalc/goalc --game jak2 --cmd "(make-group \"all-code\")"
./build/goalc/goalc --game jak3 --cmd "(make-group \"all-code\")"
mv ./out/jak1/obj ./out/jak1/obj.master
mv ./out/jak2/obj ./out/jak2/obj.master
mv ./out/jak3/obj ./out/jak3/obj.master
cmake --build build --parallel $((`nproc`)) --target goalc
mv ./build ./build.master
- name: Checkout PR
uses: actions/checkout@v4
Expand All @@ -71,6 +64,15 @@ jobs:
- name: Build goalc (PR)
run: cmake --build build --parallel $((`nproc`)) --target goalc

- name: Compile and preserve (master)
run: |
./build.master/goalc/goalc --game jak1 --cmd "(make-group \"all-code\")"
./build.master/goalc/goalc --game jak2 --cmd "(make-group \"all-code\")"
./build.master/goalc/goalc --game jak3 --cmd "(make-group \"all-code\")"
mv ./out/jak1/obj ./out/jak1/obj.master
mv ./out/jak2/obj ./out/jak2/obj.master
mv ./out/jak3/obj ./out/jak3/obj.master
- name: Compile and preserve (PR)
run: |
./build/goalc/goalc --game jak1 --cmd "(make-group \"all-code\")"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/cut-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ jobs:
metadataAuthors: "bintendo42,barg"
metadataTags: "speedrunning,challenge,gameplay-mod"
metadataWebsiteUrl: "https://github.com/OpenGOAL-Mods/OG-Patched/blob/main/README.md"
skipMacOS: true
skipLinux: true
toolingBinaryDir: "out/build/Release/bin"
toolingRepo: "OpenGOAL-Mods/OG-Mod-Base"
gameAssetsDir: "game/assets"
copyEntireBinaryDir: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
35 changes: 0 additions & 35 deletions .github/workflows/draft-new-release.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/linux-build-gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ jobs:
- name: Build Project
run: cmake --build build --parallel $((`nproc`)) -- -w dupbuild=warn

- name: Run Tests
run: ./test.sh
# - name: Run Tests
# run: ./test.sh
4 changes: 2 additions & 2 deletions .github/workflows/macos-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
- name: Build Project
run: cmake --build build --parallel $((`sysctl -n hw.logicalcpu`))

- name: Run Tests
run: ./test.sh
# - name: Run Tests
# run: ./test.sh

- name: Prepare artifacts
if: ${{ inputs.uploadArtifacts }}
Expand Down
95 changes: 65 additions & 30 deletions .github/workflows/release-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,48 @@
name: 🏭 Release Pipeline
name: 🏭 Draft Release

on:
push:
tags:
- v*
workflow_dispatch:
inputs:
bump:
description: 'Semver Bump Type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

permissions:
contents: write

jobs:
cut-release:
name: Cut Release
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.set_tag.outputs.new_tag }}
steps:
# Docs - https://github.com/mathieudutour/github-tag-action
- name: Bump Version and Push Tag
if: github.repository == 'OpenGOAL-Mods/OG-Mod-Base'
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: v
default_bump: ${{ github.event.inputs.bump }}

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ steps.tag_version.outputs.new_tag }} --generate-notes --draft --repo ${{ github.repository }}

- name: Output new tag
id: set_tag
run: |
echo "new_tag=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT
# Windows
build_windows_clang:
name: "🖥️ Windows"
Expand All @@ -29,26 +63,29 @@ jobs:
uploadArtifacts: true
secrets: inherit

# # macOS
# build_macos_intel:
# name: "🍎 MacOS"
# uses: ./.github/workflows/macos-build.yaml
# with:
# cmakePreset: "Release-macos-clang-static"
# cachePrefix: "static"
# uploadArtifacts: true
# secrets: inherit
# macOS
build_macos_intel:
name: "🍎 MacOS"
uses: ./.github/workflows/macos-build.yaml
with:
cmakePreset: "Release-macos-clang-static"
cachePrefix: "static"
uploadArtifacts: true
secrets: inherit

# Upload the Artifacts
upload_artifacts:
needs:
- cut-release
- build_windows_clang
- build_linux_clang
# - build_macos_intel
- build_macos_intel
name: "Upload Artifacts"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.cut-release.outputs.new_tag }}

- name: Prepare Artifact Folder
run: mkdir -p ./ci-artifacts/final
Expand All @@ -66,7 +103,7 @@ jobs:
mkdir -p ./ci-artifacts/linux
./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/linux ./ci-artifacts/opengoal-linux-static ./
pushd ci-artifacts/linux
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
TAG_VAL=${{ needs.cut-release.outputs.new_tag }}
tar czf ../final/opengoal-linux-${TAG_VAL}.tar.gz .
popd
chmod +x ./ci-artifacts/opengoal-linux-static/lsp/lsp
Expand All @@ -76,31 +113,29 @@ jobs:
run: |
mkdir -p ./ci-artifacts/windows
./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/windows ./ci-artifacts/opengoal-windows-static ./
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
TAG_VAL=${{ needs.cut-release.outputs.new_tag }}
7z a -tzip ./ci-artifacts/final/opengoal-windows-${TAG_VAL}.zip ./ci-artifacts/windows/*
cp ./ci-artifacts/opengoal-windows-static/lsp.exe ./ci-artifacts/final/opengoal-lsp-windows-${TAG_VAL}.exe
# - name: Prepare macOS Build Assets
# run: |
# mkdir -p ./ci-artifacts/macos
# ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos ./ci-artifacts/opengoal-macos-static ./
# pushd ci-artifacts/macos
# TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
# tar czf ../final/opengoal-macos-intel-${TAG_VAL}.tar.gz .
# popd
# chmod +x ./ci-artifacts/opengoal-macos-static/lsp/lsp
# cp ./ci-artifacts/opengoal-macos-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-intel-${TAG_VAL}.bin
- name: Prepare macOS Build Assets
run: |
mkdir -p ./ci-artifacts/macos
./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos ./ci-artifacts/opengoal-macos-static ./
pushd ci-artifacts/macos
TAG_VAL=${{ needs.cut-release.outputs.new_tag }}
tar czf ../final/opengoal-macos-intel-${TAG_VAL}.tar.gz .
popd
chmod +x ./ci-artifacts/opengoal-macos-static/lsp/lsp
cp ./ci-artifacts/opengoal-macos-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-intel-${TAG_VAL}.bin
- name: Upload Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/final/* --repo ${{ github.repository }} --clobber
gh release upload ${{ needs.cut-release.outputs.new_tag }} ${{ github.WORKSPACE }}/ci-artifacts/final/* --repo ${{ github.repository }} --clobber
- name: Publish Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
gh release edit ${TAG_VAL} --draft=false --repo ${{ github.repository }}
gh release edit ${{ needs.cut-release.outputs.new_tag }} --draft=false --repo ${{ github.repository }}
12 changes: 6 additions & 6 deletions .github/workflows/windows-build-msvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
set CL=/MP
cmake --build build --parallel %NUMBER_OF_PROCESSORS%
- name: Run Tests
timeout-minutes: 10
env:
GTEST_OUTPUT: "xml:opengoal-test-report.xml"
run: |
./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=0 --gtest_filter="-*MANUAL_TEST*"
# - name: Run Tests
# timeout-minutes: 10
# env:
# GTEST_OUTPUT: "xml:opengoal-test-report.xml"
# run: |
# ./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=0 --gtest_filter="-*MANUAL_TEST*"

19 changes: 5 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ prof.json
cmake-build-debug/*
cmake-build-debug--o0/*
.idea/*
build/*
build/
build.master/
/decompiler_out*
logs/*
profile_data/*
Expand Down Expand Up @@ -61,19 +62,9 @@ node_modules/
# custom_assets/jak3/texture_replacements/*

# merc replacements
custom_assets/jak1/merc_replacements/*
custom_assets/jak2/merc_replacements/*
custom_assets/jak3/merc_replacements/*

# merc replacements
custom_assets/jak1/merc_replacements/*
custom_assets/jak2/merc_replacements/*
custom_assets/jak3/merc_replacements/*

# merc replacements
custom_assets/jak1/merc_replacements/*
custom_assets/jak2/merc_replacements/*
custom_assets/jak3/merc_replacements/*
# custom_assets/jak1/merc_replacements/*
# custom_assets/jak2/merc_replacements/*
# custom_assets/jak3/merc_replacements/*

# generated cmake files
svnrev.h
Expand Down
11 changes: 11 additions & 0 deletions common/math/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,17 @@ struct Matrix {
return result;
}

Matrix<T, Rows, Cols> transposed() const {
static_assert(Rows == Cols);
Matrix<T, Rows, Cols> ret;
for (int i = 0; i < Rows; i++) {
for (int j = 0; j < Cols; j++) {
ret(i, j) = operator()(j, i);
}
}
return ret;
}

template <int OtherCols>
Matrix<T, Rows, OtherCols> operator*(const Matrix<T, Cols, OtherCols>& y) const {
Matrix<T, Rows, OtherCols> result;
Expand Down
Loading

0 comments on commit e9b01af

Please sign in to comment.