Skip to content

Commit

Permalink
🆕 [CI] Add C++ standards to the build matrix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jonathan Gopel committed Nov 14, 2020
1 parent f8640d4 commit cddc7ea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,35 @@ jobs:
strategy:
matrix:
cxx: [g++-4.8, g++-8, g++-10, clang++-9]
standard: [11, 14, 17, 20]
build_type: [Debug, Release]
std: [11]
include:
- cxx: g++-4.8
install: sudo apt install g++-4.8
- cxx: g++-8
std: 14
- cxx: g++-10
std: 17
- cxx: clang++-9
std: 11
- cxx: clang++-9
build_type: Debug
fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
std: 17
exclude:
- cxx: g++-4.8
standard: 14
- cxx: g++-4.8
standard: 17
- cxx: g++-4.8
standard: 20

- cxx: g++-8
standard: 11
- cxx: g++-8
standard: 17
- cxx: g++-8
standard: 20

- cxx: g++-10
standard: 11
- cxx: g++-10
standard: 14

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
runs-on: macos-10.15
strategy:
matrix:
standard: [11, 14, 17, 20]
build_type: [Debug, Release]

steps:
Expand All @@ -19,7 +20,8 @@ jobs:
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \
-DCMAKE_CXX_STANDARD=${{matrix.standard}} $GITHUB_WORKSPACE
- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down

0 comments on commit cddc7ea

Please sign in to comment.