Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++ standards to CI config (Linux) #1992

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,49 @@ jobs:
strategy:
matrix:
cxx: [g++-4.8, g++-8, g++-10, clang++-9]
standard: [11, 14, 17, 20]
build_type: [Debug, Release]
include:
- cxx: clang++-9
build_type: Debug
fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
- cxx: g++-4.8
install: sudo apt install g++-4.8
exclude: # filter some configurations
### gcc 4.8
# does not fully support c++14
- cxx: g++-4.8
standard: 14
# does not support c++17
- cxx: g++-4.8
standard: 17
# does not support c++20
- cxx: g++-4.8
standard: 20

### gcc 8
# has c++14 as default mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't mean someone won't use c++11 on gcc-8.
If resources aren't a constrain I wouldn't exclude it from checks.

Same comment for other excludes like this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just impressed by the number of configurations without any filtering.
Maybe I over-filtered them.
But I don't know if they make any sense, for example, is it possible that c++11 on gcc-8 fails while c++11 on gcc-4.8 doesn't? It can be possible of course, because of some bugs, but if we are hunting for bugs here then this config should have a huge number of configurations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point.
However following this though, standard shouldn't be a matrix parameter.
Check default on each compiler and have separate matrix for all cpp standards tested on newest compilers only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is a good suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think it will be better to create a new PR with the described logic because the logic here and the logic you proposed differ. I can create it, or maybe you want to do this?

- cxx: g++-8
standard: 11
# does not fully support c++20
- cxx: g++-8
standard: 20

### gcc 10
# has c++14 as default mode
- cxx: g++-10
standard: 11
# does not fully support c++20
- cxx: g++-10
standard: 20

### clang 9
# has c++14 as default mode
- cxx: clang++-9
standard: 11
# does not fully support c++20
- cxx: clang++-9
standard: 20

steps:
- uses: actions/checkout@v2
Expand All @@ -29,8 +65,8 @@ jobs:
env:
CXX: ${{matrix.cxx}}
run: |
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.fuzz}} \
-DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_STANDARD=${{matrix.standard}} \
${{matrix.fuzz}} -DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE

- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down