Skip to content

Add GitHub Actions CI: build + install on Windows, Linux, macOS #1

Add GitHub Actions CI: build + install on Windows, Linux, macOS

Add GitHub Actions CI: build + install on Windows, Linux, macOS #1

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
# --- dependencies ---
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev nlohmann-json3-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install nlohmann-json # libcurl ships with macOS
# --- configure ---
- name: Configure (Linux/macOS, system packages)
if: runner.os != 'Windows'
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
- name: Configure (Windows, vcpkg)
if: runner.os == 'Windows'
shell: bash
run: cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
# --- build + verify install/export ---
- name: Build
run: cmake --build build --config Release
- name: Install (verify export)
run: cmake --install build --config Release --prefix "${{ runner.temp }}/nml-install"