mirror of
https://github.com/Dillonb/n64.git
synced 2025-04-02 10:42:08 -04:00
115 lines
2.9 KiB
YAML
115 lines
2.9 KiB
YAML
name: Build
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-2019
|
|
env:
|
|
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Export GitHub Actions cache environment variables
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
|
|
- name: Setup dependencies
|
|
run: |
|
|
vcpkg install shaderc:x64-windows
|
|
vcpkg install sdl2[vulkan]:x64-windows
|
|
|
|
- name: Build N64
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_BUILD_TYPE=Release -T clangcl -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ..
|
|
cmake --build . --config Release
|
|
shell: cmd
|
|
|
|
- name: Collect files
|
|
run: |
|
|
mkdir upload
|
|
move build\Release\n64.exe upload
|
|
move build\Release\SDL2.dll upload
|
|
|
|
- name: Upload files
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: n64-windows
|
|
path: upload
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup dependencies
|
|
run: |
|
|
sudo apt-get update -y -qq
|
|
sudo apt-get install glslc libsdl2-dev libdbus-1-dev libbz2-dev ninja-build
|
|
|
|
- name: Setup chksum64 and bass
|
|
run: |
|
|
mkdir -p tmp
|
|
cd tmp
|
|
wget https://raw.githubusercontent.com/DragonMinded/libdragon/8c4e8505778a5c84e5477394eddfb127ce44d71b/tools/chksum64.c
|
|
gcc chksum64.c -o chksum64
|
|
sudo mv chksum64 /bin/
|
|
git clone https://github.com/ARM9/bass.git
|
|
cd bass/bass
|
|
git checkout v14
|
|
make
|
|
sudo mv bass /bin/
|
|
|
|
- name: Build N64
|
|
run: |
|
|
mkdir -p build
|
|
cd build
|
|
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
|
|
ninja
|
|
strip n64
|
|
|
|
- name: Run tests on N64
|
|
env:
|
|
CTEST_OUTPUT_ON_FAILURE: 1
|
|
run: |
|
|
cd build
|
|
ninja test
|
|
|
|
- name: Collect files
|
|
run: |
|
|
mkdir upload
|
|
mv build/n64 upload
|
|
|
|
- name: Upload files
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: n64-linux
|
|
path: upload
|
|
|
|
build-nix:
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-22.04
|
|
- macos-14
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
- uses: DeterminateSystems/flake-checker-action@main
|
|
- name: Run `nix build`
|
|
run: nix build .
|