Files
xeghosted--OrbisForge/.github/workflows/ci.yml
T

115 lines
3.6 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_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
run: |
set -e
URL=$(curl -s https://api.github.com/repos/OpenOrbis/OpenOrbis-PS4-Toolchain/releases/latest | grep browser_download_url | cut -d '"' -f4)
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: 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