fmt/.github/workflows/macos.yml
Jonathan Gopel 1f6635edd0 🆕 [CI] Add C++ standards to the build matrix
Problem:
- A variety of compilers are tested in CI, but they are all tested on
  the C++11 standard. This prevents CI from catching bugs that exist
  only on a particular version of the C++ standard.

Solution:
- Parameterize CI on C++ standards 11, 14, 17, and 20.
2020-11-13 06:04:02 -07:00

33 lines
854 B
YAML

name: macos
on: [push, pull_request]
jobs:
build:
runs-on: macos-10.15
strategy:
matrix:
standard: [11, 14, 17, 20]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \
-DCMAKE_CXX_STANDARD=${{matrix.standard}} $GITHUB_WORKSPACE
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{matrix.build_type}}
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}}