Skip to content

build

build #431

Workflow file for this run

name: build
on:
pull_request:
push:
schedule:
- cron: '0 0 1 * *'
jobs:
build:
name: >
${{ matrix.os }}, ${{ matrix.compiler }}${{
matrix.version && format('-{0}', matrix.version) || ''
}}${{
format(', boost-{0}', matrix.boost-version || '1.89.0')
}}${{
matrix.backend && format(', {0}', matrix.backend) || ''
}}${{
matrix.extra-desc && format(', {0}', matrix.extra-desc) || ''
}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# GCC builds
- {os: ubuntu-24.04, compiler: gcc, version: '10',
flags: '-Wsuggest-override'}
- {os: ubuntu-24.04, compiler: gcc, version: '11',
flags: '-Wsuggest-override'}
- {os: ubuntu-24.04, compiler: gcc, version: '12',
flags: '-Wsuggest-override'}
- {os: ubuntu-24.04, compiler: gcc, version: '13',
flags: '-Wsuggest-override'}
- {os: ubuntu-24.04, compiler: gcc, version: '14',
flags: '-Wsuggest-override'}
# Clang builds
- {os: ubuntu-22.04, compiler: clang, version: '10'}
- {os: ubuntu-22.04, compiler: clang, version: '11'}
- {os: ubuntu-22.04, compiler: clang, version: '12'}
- {os: ubuntu-24.04, compiler: clang, version: '13'}
- {os: ubuntu-24.04, compiler: clang, version: '14'}
- {os: ubuntu-24.04, compiler: clang, version: '15'}
- {os: ubuntu-24.04, compiler: clang, version: '16'}
- {os: ubuntu-24.04, compiler: clang, version: '17'}
- {os: ubuntu-24.04, compiler: clang, version: '18'}
- {os: ubuntu-24.04, compiler: clang, version: '19', llvm-apt: true}
- {os: ubuntu-24.04, compiler: clang, version: '20', llvm-apt: true}
# Windows builds
- {os: windows-latest, compiler: msvc, version: '14.4'} # VS 2022
# macOS builds
- {os: macos-latest, compiler: clang}
# NDEBUG builds
- {os: ubuntu-24.04, compiler: gcc, version: '14',
flags: '-Wsuggest-override -DNDEBUG', extra-desc: 'NDEBUG'}
- {os: ubuntu-24.04, compiler: clang, version: '20', llvm-apt: true,
flags: '-DNDEBUG', extra-desc: 'NDEBUG'}
- {os: windows-latest, compiler: msvc, flags: '/DNDEBUG',
version: '14.4', extra-desc: 'NDEBUG'}
- {os: macos-latest, compiler: clang, flags: '-DNDEBUG',
extra-desc: 'NDEBUG'}
# Hidden symbols builds
- {os: ubuntu-24.04, compiler: gcc, version: '14',
flags: '-fvisibility=hidden -fvisibility-inlines-hidden',
extra-desc: '-fvisibility=hidden'}
- {os: ubuntu-24.04, compiler: clang, version: '20', llvm-apt: true,
flags: '-fvisibility=hidden -fvisibility-inlines-hidden',
extra-desc: '-fvisibility=hidden'}
# C++23 builds
- {os: ubuntu-24.04, compiler: gcc, version: '14',
options: '--std=c++23', flags: '-Wsuggest-override',
extra-desc: 'c++23'}
- {os: ubuntu-24.04, compiler: clang, version: '20', llvm-apt: true,
options: '--std=c++2b', extra-desc: 'c++23'}
# Make-backend builds
- {os: ubuntu-24.04, compiler: gcc, version: '14', backend: 'make',
flags: '-Wsuggest-override'}
- {os: ubuntu-latest, compiler: clang, version: '20', llvm-apt: true,
backend: 'make'}
# Boost 1.67 builds (our minimum required Boost)
- {os: ubuntu-24.04, compiler: gcc, version: '14',
flags: '-Wsuggest-override', boost-version: '1.67.0'}
# Boost from APT builders
- {os: ubuntu-24.04, compiler: gcc, version: '14',
flags: '-Wsuggest-override', boost-version: 'apt'}
fail-fast: false
env:
COMMONFLAGS: '-Wall -Wextra -pedantic -Werror'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install Python dependencies
run: >-
pip install
git+https://github.com/jimporter/bfg9000.git
git+https://github.com/jimporter/mopack.git
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: sudo apt-get install ninja-build
- name: Install Windows dependencies
if: startsWith(matrix.os, 'windows-')
run: |
choco install ninja pkgconfiglite
echo "CXXFLAGS=/W3 /WX ${{ matrix.flags }}" >> ${env:GITHUB_ENV}
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macos-')
run: |
brew install ninja pkg-config
echo "CXXFLAGS=${COMMONFLAGS} ${{ matrix.flags }}" >> ${GITHUB_ENV}
- name: Install gcc
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-${{ matrix.version }}
echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "CXXFLAGS=${COMMONFLAGS} ${{ matrix.flags }}" >> ${GITHUB_ENV}
- name: Install clang
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang' &&
matrix.llvm-apt
run: |
export CODENAME=`lsb_release -c | sed 's/Codename:\t//'`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${{ matrix.version }} main"
sudo apt-get update
sudo apt-get install clang-${{ matrix.version }}
echo "CXX=clang++-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "CXXFLAGS=${COMMONFLAGS} ${{ matrix.flags }}" >> ${GITHUB_ENV}
- name: Initialize MSVC ${{ matrix.version }}
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: ${{ matrix.version }}
- name: Configure mettle
run: >-
9k build --backend=${{ matrix.backend || 'ninja' }}
${{ matrix.options }}
-p.github/mopack/boost-${{ matrix.boost-version || '1.89.0' }}.yml
- name: Run tests
run: |
cd build
${{ matrix.backend || 'ninja' }} test