Skip to content

Build

Build #390

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
branches:
- dev
pull_request:
branches:
- master
release:
types:
- published
schedule:
- cron: "0 0 * * 1" # Runs every Monday at midnight UTC
env:
BUILD_TYPE: Release
jobs:
build:
permissions:
actions: read
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-24.04
compiler: gcc-13
compilercxx: g++-13
multiline-separator: \
- name: Ubuntu Clang
os: ubuntu-24.04
compiler: clang
compilercxx: clang++
multiline-separator: \
- name: Windows MSVC
os: windows-latest
compiler: msvc
compilercxx: msvc
multiline-separator: "`"
- name: MacOS ARM AppleClang
os: macos-latest
compiler: clang
compilercxx: clang++
multiline-separator: \
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
# Further brew packages needed to run/install vcpkg dependencies
- name: Setup MacOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install ninja
brew install autoconf
brew install libtool
brew install automake
- name: Restore vcpkg cache
id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
prefix: vcpkg-build/
- name: Configure CMake ${{ matrix.os }}-${{ matrix.compilercxx }}
env:
VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
run: |
cmake -B ${{github.workspace}}/build ${{ matrix.multiline-separator}}
-DCMAKE_OSX_ARCHITECTURES="arm64" ${{ matrix.multiline-separator}}
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.multiline-separator}}
-DPSAPI_BUILD_DOCS=OFF ${{ matrix.multiline-separator}}
-DPSAPI_BUILD_BENCHMARKS=OFF ${{ matrix.multiline-separator}}
-DPSAPI_BUILD_TESTS=OFF ${{ matrix.multiline-separator}}
-DPSAPI_BUILD_EXAMPLES=ON ${{ matrix.multiline-separator}}
-DPSAPI_BUILD_PYTHON=OFF
- name: Build ${{ matrix.os }}-${{ matrix.compilercxx }}
# Build your program with the given configuration
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
run: |
cmake --build ${{github.workspace}}/build ${{ matrix.multiline-separator}}
--config ${{env.BUILD_TYPE}} ${{ matrix.multiline-separator}}
--parallel $(getconf _NPROCESSORS_ONLN || sysctl -n hw.ncpu || echo %NUMBER_OF_PROCESSORS%)