name: Test
on:
push:
pull_request:
schedule:
# Weekly, at 5:45 AM on Friday (somewhat randomly chosen).
- cron: '45 5 * * 5'
workflow_dispatch:
jobs:
old_and_new:
strategy:
matrix:
version: [1.58.0, 1.78.0]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
toolset: [auto, clang, gcc, mingw, msvc]
exclude:
# No Visual Studio on Linux.
- {os: ubuntu-18.04, toolset: msvc}
- {os: ubuntu-20.04, toolset: msvc}
- {os: ubuntu-22.04, toolset: msvc}
# GCC == MinGW-w64 on Windows.
- {os: windows-2019, toolset: gcc}
- {os: windows-2022, toolset: gcc}
# MinGW should be the same across different Windows versions.
- {os: windows-2019, toolset: mingw}
# VS 2022 doesn't support older Boost versions.
- {os: windows-2022, version: 1.58.0}
runs-on: '${{ matrix.os }}'
name: '${{ matrix.version }} / ${{ matrix.os }} / ${{ matrix.toolset }}'
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Boost
uses: actions/cache@v3
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{ matrix.version }}'
- name: Clean up PATH
uses: egor-tensin/cleanup-path@v3
if: runner.os == 'Windows'
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
if: matrix.toolset == 'gcc'
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
if: matrix.toolset == 'mingw' || (matrix.toolset == 'clang' && runner.os == 'Windows')
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
if: matrix.toolset == 'clang'
- id: build
name: Build Boost
uses: ./
with:
version: '${{ matrix.version }}'
toolset: '${{ matrix.toolset }}'
configuration: Release
static: 1
libraries: filesystem program_options system
- name: Check Boost
uses: ./.github/actions/check-boost
with:
# This tests that Boost is indeed in that directory, don't replace
# with ${{ steps.build.outputs.root }}.
root: '${{ runner.workspace }}/boost'
- name: Check libraries
uses: ./.github/actions/check-libraries
with:
toolset: '${{ matrix.toolset }}'
librarydir: '${{ steps.build.outputs.librarydir }}'
libraries: filesystem program_options system
static: 1
different_configurations:
strategy:
matrix:
os: [ubuntu-latest, windows-2019, windows-2022]
platform: [x64, x86]
configuration: [Debug, Release]
runs-on: '${{ matrix.os }}'
name: '${{ matrix.os }} / ${{ matrix.platform }} / ${{ matrix.configuration }}'
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Boost
uses: actions/cache@v3
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{ matrix.version }}'
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
platform: '${{ matrix.platform }}'
if: runner.os == 'Linux'
- id: build
name: Build Boost
uses: ./
with:
version: 1.78.0
platform: '${{ matrix.platform }}'
configuration: '${{ matrix.configuration }}'
libraries: filesystem program_options system
directory: '${{ runner.workspace }}/foo'
- name: Check Boost
uses: ./.github/actions/check-boost
with:
# This tests that Boost is indeed in that directory, don't replace
# with ${{ steps.build.outputs.root }}.
root: '${{ runner.workspace }}/foo'
- name: Check libraries
uses: ./.github/actions/check-libraries
with:
librarydir: '${{ steps.build.outputs.librarydir }}'
libraries: filesystem program_options system
macos:
strategy:
matrix:
# 1.71.0 is the earliest version to not fail with these errors:
#
# clang: error: unknown argument: '-fcoalesce-templates'
#
version: [1.71.0, 1.74.0]
os: [macos-10.15, macos-11]
toolset: [auto]
runs-on: '${{ matrix.os }}'
name: '${{ matrix.version }} / ${{ matrix.os }} / ${{ matrix.toolset }}'
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Boost
uses: actions/cache@v3
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{ matrix.version }}'
- id: build
name: Build Boost
uses: ./
with:
version: '${{ matrix.version }}'
toolset: '${{ matrix.toolset }}'
configuration: Release
static: 1
libraries: filesystem program_options system
- name: Check Boost
uses: ./.github/actions/check-boost
with:
# This tests that Boost is indeed in that directory, don't replace
# with ${{ steps.build.outputs.root }}.
root: '${{ runner.workspace }}/boost'
- name: Check libraries
uses: ./.github/actions/check-libraries
with:
toolset: '${{ matrix.toolset }}'
librarydir: '${{ steps.build.outputs.librarydir }}'
libraries: filesystem program_options system
static: 1