mirror of
https://github.com/xeghosted/OrbisForge.git
synced 2026-10-06 10:00:39 +02:00
The SDK's Makefile archives libGoldHEN_Hook.a with llvm-ar, which the runner's clang package does not pull in, so the ci_ghplugin job failed with "llvm-ar: not found". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
142 lines
5.0 KiB
YAML
142 lines
5.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
unit-tests:
|
|
name: Unit tests (OrbisForge.Core)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Run tests
|
|
run: dotnet test tests/OrbisForge.Core.Tests --logger "console;verbosity=normal"
|
|
|
|
generate-and-build:
|
|
name: Generate + build (${{ matrix.name }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: ci_exe
|
|
type: exe
|
|
extra_args: ""
|
|
artifact: build/eboot.bin
|
|
- name: ci_prx
|
|
type: prx
|
|
extra_args: ""
|
|
artifact: build/ci_prx.prx
|
|
- name: ci_sprx
|
|
type: sprx
|
|
extra_args: ""
|
|
artifact: build/ci_sprx.sprx
|
|
- name: ci_ghplugin
|
|
type: ghplugin
|
|
extra_args: ""
|
|
artifact: build/ci_ghplugin.prx
|
|
- name: ci_pkg
|
|
type: exe
|
|
extra_args: "--pkg"
|
|
artifact: "build/pkg_root/*.pkg"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install build tools
|
|
run: sudo apt-get update && sudo apt-get install -y clang lld cmake libicu-dev
|
|
|
|
# PkgTool.Core (bundled in the OpenOrbis release, used for the --pkg case) is a
|
|
# published .NET binary that needs libssl.so.1.1 -- current Ubuntu runner images
|
|
# only ship libssl3. Same fix used for the real toolchain install.
|
|
- name: Install libssl1.1 (PkgTool.Core dependency)
|
|
run: |
|
|
curl -sLO http://old-releases.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
|
|
sudo apt-get install -y ./libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
|
|
|
|
- name: Install .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Install OpenOrbis PS4 Toolchain
|
|
env:
|
|
# Unauthenticated GitHub API calls are capped at 60/hour PER IP, and GitHub-hosted
|
|
# runners share IP pools across the whole platform -- that budget gets exhausted by
|
|
# unrelated workflows constantly. Authenticating with the auto-provided GITHUB_TOKEN
|
|
# raises it to 5000/hour, scoped to this run.
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
set -e
|
|
URL=$(curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/OpenOrbis/OpenOrbis-PS4-Toolchain/releases/latest | grep browser_download_url | cut -d '"' -f4)
|
|
if [ -z "$URL" ]; then
|
|
echo "::error::Could not resolve the OpenOrbis toolchain download URL (GitHub API call returned no browser_download_url)."
|
|
exit 1
|
|
fi
|
|
curl -L -o toolchain.tar.gz "$URL"
|
|
mkdir -p /tmp/oo-extract
|
|
tar -xzf toolchain.tar.gz -C /tmp/oo-extract
|
|
mv /tmp/oo-extract/OpenOrbis/PS4Toolchain "$HOME/OpenOrbis-PS4-Toolchain"
|
|
echo "OO_PS4_TOOLCHAIN=$HOME/OpenOrbis-PS4-Toolchain" >> "$GITHUB_ENV"
|
|
echo "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" >> "$GITHUB_ENV"
|
|
|
|
- name: Install GoldHEN Plugin SDK
|
|
if: matrix.type == 'ghplugin'
|
|
run: |
|
|
set -e
|
|
# The SDK's Makefile archives with llvm-ar, which the clang package does
|
|
# not pull in on the runner image.
|
|
sudo apt-get install -y llvm
|
|
git clone --depth 1 https://github.com/GoldHEN/GoldHEN_Plugins_SDK.git /tmp/goldhen-sdk
|
|
make -C /tmp/goldhen-sdk install
|
|
# 'make install' ships the headers and libGoldHEN_Hook.a but leaves crtprx.o
|
|
# behind in the SDK's own build dir; TYPE GHPLUGIN looks for it in lib/.
|
|
cp /tmp/goldhen-sdk/build/crtprx.o "$OO_PS4_TOOLCHAIN/lib/"
|
|
|
|
- name: Build OrbisForge CLI
|
|
run: dotnet publish src/OrbisForge.Cli -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true -o publish/linux-x64
|
|
|
|
- name: Generate project
|
|
run: |
|
|
chmod +x publish/linux-x64/orbisforge
|
|
./publish/linux-x64/orbisforge new --name ${{ matrix.name }} --type ${{ matrix.type }} --output /tmp/gen ${{ matrix.extra_args }}
|
|
|
|
- name: Build generated project
|
|
working-directory: /tmp/gen/${{ matrix.name }}
|
|
run: bash build.sh
|
|
|
|
- name: Build .pkg target
|
|
if: matrix.extra_args == '--pkg'
|
|
working-directory: /tmp/gen/${{ matrix.name }}
|
|
run: cmake --build build --target ${{ matrix.name }}_pkg
|
|
|
|
- name: Verify artifact
|
|
working-directory: /tmp/gen/${{ matrix.name }}
|
|
run: ls -la ${{ matrix.artifact }}
|
|
|
|
build-gui:
|
|
name: Build solution (Windows, incl. GUI)
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Build full solution
|
|
run: dotnet build OrbisForge.slnx
|