wip #417
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
- push | |
- pull_request | |
jobs: | |
flake-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- run: nix flake check | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
installable: | |
- "brender" | |
- "brender-samples" | |
- "brender-samples-clang" | |
- "brender-samples-win64" | |
- "brender-samples-win32" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- run: nix build -L .#${{matrix.installable}} | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Dependencies | |
run: sudo apt install -y --no-install-recommends libsdl2-dev libglfw3-dev ninja-build | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Configure | |
run: cmake -B build -G "Ninja Multi-Config" | |
- name: Build | |
run: cmake --build build --config Release --parallel | |
build-msvc2022: | |
runs-on: windows-2022 | |
env: | |
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' | |
strategy: | |
matrix: | |
configuration: | |
- { platform: 'x64', soft: 'OFF', vcpkg_target: 'x64-windows' } | |
- { platform: 'Win32', soft: 'OFF', vcpkg_target: 'x86-windows' } | |
- { platform: 'Win32', soft: 'ON', vcpkg_target: 'x86-windows' } | |
steps: | |
- 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: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Install SDL2 | |
run: vcpkg install sdl2:${{ matrix.configuration.vcpkg_target }} | |
- name: Install GLFW3 | |
run: vcpkg install glfw3:${{ matrix.configuration.vcpkg_target }} | |
- name: Configure | |
run: > | |
cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.configuration.platform }} | |
-DCMAKE_BUILD_TYPE=Release | |
-DBRENDER_BUILD_SOFT=${{ matrix.configuration.soft }} | |
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" | |
- name: Build | |
run: cmake --build build --parallel |