2024-05-18 02:23:48 +00:00
|
|
|
name: validate
|
|
|
|
on:
|
2024-06-02 14:34:25 +00:00
|
|
|
workflow_call:
|
|
|
|
secrets:
|
|
|
|
ZRE_REPO_WITH_PAT:
|
|
|
|
required: true
|
2024-05-18 02:23:48 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
2024-05-27 10:33:15 +00:00
|
|
|
build-linux:
|
|
|
|
runs-on: ${{ matrix.arch == 'x64' && matrix.os || format('blaze/{0}', matrix.os) }}
|
2024-05-18 02:23:48 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
type: [ Debug, Release ]
|
2024-05-27 10:33:15 +00:00
|
|
|
os: [ ubuntu-22.04 ]
|
|
|
|
arch: [ x64, arm64 ]
|
|
|
|
name: ${{ matrix.os }} (${{ matrix.arch }}, ${{ matrix.type }})
|
2024-05-18 02:23:48 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-05-20 20:55:59 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
2024-05-18 02:23:48 +00:00
|
|
|
submodules: recursive
|
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
2024-06-05 05:58:24 +00:00
|
|
|
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-${{ matrix.arch }}
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Install Linux Dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-05-22 08:55:12 +00:00
|
|
|
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
# Install SDL2
|
|
|
|
echo ::group::install SDL2
|
|
|
|
|
|
|
|
# Enable ccache
|
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
2024-06-08 19:09:08 +00:00
|
|
|
wget https://github.com/libsdl-org/SDL/releases/download/release-2.26.1/SDL2-2.26.1.tar.gz
|
2024-05-18 02:23:48 +00:00
|
|
|
tar -xzf SDL2-2.26.1.tar.gz
|
|
|
|
cd SDL2-2.26.1
|
|
|
|
./configure
|
|
|
|
make -j 10
|
|
|
|
sudo make install
|
|
|
|
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
|
|
|
echo ::endgroup::
|
|
|
|
- name: Prepare Build
|
|
|
|
run: |-
|
2024-05-18 20:35:13 +00:00
|
|
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
2024-05-18 02:23:48 +00:00
|
|
|
./zre/process.sh
|
2024-06-02 18:18:50 +00:00
|
|
|
cp ./zre/mm_shader_cache.bin ./shadercache/
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Build N64Recomp & RSPRecomp
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
|
|
|
cd N64RecompSource
|
2024-06-05 05:58:24 +00:00
|
|
|
git checkout 2a2df89349ff25a3afb3a09617deb3a166efe2f3
|
2024-06-03 19:39:20 +00:00
|
|
|
git submodule update --init --recursive
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
# enable ccache
|
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
|
|
|
# Build N64Recomp & RSPRecomp
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
2024-06-07 08:39:47 +00:00
|
|
|
cmake --build cmake-build --config Release --target N64Recomp -j $(nproc)
|
|
|
|
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
# Copy N64Recomp & RSPRecomp to root directory
|
|
|
|
cp cmake-build/N64Recomp ..
|
|
|
|
cp cmake-build/RSPRecomp ..
|
|
|
|
- name: Run N64Recomp & RSPRecomp
|
|
|
|
run: |
|
|
|
|
./N64Recomp us.rev1.toml
|
|
|
|
./RSPRecomp aspMain.us.rev1.toml
|
|
|
|
./RSPRecomp njpgdspMain.us.rev1.toml
|
|
|
|
- name: Build ZeldaRecomp
|
|
|
|
run: |-
|
|
|
|
# enable ccache
|
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
2024-06-07 08:39:47 +00:00
|
|
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $(nproc)
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Prepare Archive
|
|
|
|
run: |
|
|
|
|
mv cmake-build/Zelda64Recompiled Zelda64Recompiled
|
|
|
|
rm -rf assets/scss
|
2024-05-27 10:33:15 +00:00
|
|
|
tar -czf Zelda64Recompiled.tar.gz Zelda64Recompiled assets/
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Archive Zelda64Recomp
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-05-27 10:33:15 +00:00
|
|
|
name: Zelda64Recompiled-${{ runner.os }}-${{ runner.arch }}-${{ matrix.type }}
|
|
|
|
path: Zelda64Recompiled.tar.gz
|
2024-05-22 08:55:12 +00:00
|
|
|
- name: Prepare AppImage
|
|
|
|
run: ./.github/linux/appimage.sh
|
|
|
|
- name: Zelda64Recomp AppImage
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-05-27 10:33:15 +00:00
|
|
|
name: Zelda64Recompiled-AppImage-${{ runner.arch }}-${{ matrix.type }}
|
|
|
|
path: Zelda64Recompiled-*.AppImage
|
2024-05-18 02:23:48 +00:00
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
type: [ Debug, Release ]
|
2024-05-27 10:33:15 +00:00
|
|
|
name: windows (${{ matrix.type }})
|
2024-05-18 02:23:48 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-05-20 20:55:59 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
2024-05-18 02:23:48 +00:00
|
|
|
submodules: recursive
|
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}
|
|
|
|
- name: Install Windows Dependencies
|
|
|
|
run: |
|
|
|
|
choco install ninja
|
|
|
|
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
|
|
|
|
- name: Configure Developer Command Prompt
|
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Prepare Build
|
|
|
|
run: |-
|
2024-05-18 20:35:13 +00:00
|
|
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
2024-05-18 02:23:48 +00:00
|
|
|
./zre/process.ps1
|
2024-06-02 18:18:50 +00:00
|
|
|
cp ./zre/mm_shader_cache.bin ./shadercache/
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Build N64Recomp & RSPRecomp
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
|
|
|
cd N64RecompSource
|
2024-06-05 05:58:24 +00:00
|
|
|
git checkout 2a2df89349ff25a3afb3a09617deb3a166efe2f3
|
2024-06-03 19:39:20 +00:00
|
|
|
git submodule update --init --recursive
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
# enable ccache
|
|
|
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
2024-06-07 08:39:47 +00:00
|
|
|
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
2024-06-07 08:39:47 +00:00
|
|
|
cmake --build cmake-build --config Release --target N64Recomp -j $cpuCores
|
|
|
|
cmake --build cmake-build --config Release --target RSPRecomp -j $cpuCores
|
2024-05-18 02:23:48 +00:00
|
|
|
|
|
|
|
# Copy N64Recomp & RSPRecomp to root directory
|
|
|
|
cp cmake-build/N64Recomp.exe ..
|
|
|
|
cp cmake-build/RSPRecomp.exe ..
|
|
|
|
- name: Run N64Recomp & RSPRecomp
|
|
|
|
run: |
|
|
|
|
./N64Recomp.exe us.rev1.toml
|
|
|
|
./RSPRecomp.exe aspMain.us.rev1.toml
|
|
|
|
./RSPRecomp.exe njpgdspMain.us.rev1.toml
|
|
|
|
- name: Build ZeldaRecomp
|
|
|
|
run: |-
|
|
|
|
# enable ccache
|
|
|
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
2024-06-07 08:39:47 +00:00
|
|
|
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
|
|
|
|
|
|
|
|
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
|
|
|
|
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
|
2024-05-18 02:23:48 +00:00
|
|
|
|
2024-06-07 08:40:34 +00:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
2024-06-07 08:39:47 +00:00
|
|
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $cpuCores
|
2024-06-07 08:40:34 +00:00
|
|
|
env:
|
|
|
|
CXXFLAGS: --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
|
|
|
|
CFLAGS: --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
|
2024-05-18 02:23:48 +00:00
|
|
|
- name: Prepare Archive
|
|
|
|
run: |
|
|
|
|
Move-Item -Path "cmake-build/Zelda64Recompiled.exe" -Destination "Zelda64Recompiled.exe"
|
2024-05-18 14:38:38 +00:00
|
|
|
Move-Item -Path "cmake-build/dxcompiler.dll" -Destination "dxcompiler.dll"
|
|
|
|
Move-Item -Path "cmake-build/dxil.dll" -Destination "dxil.dll"
|
|
|
|
Move-Item -Path "cmake-build/SDL2.dll" -Destination "SDL2.dll"
|
2024-05-18 02:23:48 +00:00
|
|
|
Remove-Item -Path "assets/scss" -Recurse -Force
|
|
|
|
- name: Archive Zelda64Recomp
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}
|
|
|
|
path: |
|
|
|
|
Zelda64Recompiled.exe
|
2024-05-18 14:38:38 +00:00
|
|
|
dxcompiler.dll
|
|
|
|
dxil.dll
|
|
|
|
SDL2.dll
|
2024-05-18 02:23:48 +00:00
|
|
|
assets/
|