72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: linux-release
|
|
build_type: Release
|
|
cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
- name: linux-asan
|
|
build_type: RelWithDebInfo
|
|
cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_ASAN=ON
|
|
name: ${{ matrix.name }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build
|
|
|
|
- name: Configure
|
|
run: cmake -S . -B build ${{ matrix.cmake_args }}
|
|
|
|
- name: Build
|
|
run: cmake --build build --parallel
|
|
|
|
- name: Upload compile commands
|
|
if: matrix.name == 'linux-release'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: compile-commands
|
|
path: build/compile_commands.json
|
|
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.name }}-binaries
|
|
path: build/bin
|
|
|
|
freebsd:
|
|
runs-on: ubuntu-latest
|
|
name: freebsd-release
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: FreeBSD build
|
|
uses: vmactions/freebsd-vm@v1
|
|
with:
|
|
usesh: true
|
|
sync: sshfs
|
|
prepare: |
|
|
pkg install -y git cmake gmake ninja
|
|
run: |
|
|
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
cmake --build build --parallel
|
|
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: freebsd-release-binaries
|
|
path: build/bin
|