Skip to content

Commit 016b2e7

Browse files
authored
CI: test with supported C++ standards (#1226)
* CI: test with supported C++ standards let's test with the supported standards for better coverage. C++23 standard was just out, but the support on the toolchain is not quite ready yet. so let's leave it for a future change. Signed-off-by: Kefu Chai <[email protected]> * CI: drop redundant Build step "Build Tests" is strictly a superset of "Build". in addition to the library, the former builds the tests also. both these steps share the same set of command line arguments. by removing "Build" step, we don't lose anything regarding the test coverage and information for further investigation if the build fails. Signed-off-by: Kefu Chai <[email protected]> --------- Signed-off-by: Kefu Chai <[email protected]>
1 parent 2383e6d commit 016b2e7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, windows-latest, macos-latest]
15+
cxx_standard: [11, 17, 20]
1516
build: [static, shared]
1617
generator: ["Default Generator", "MinGW Makefiles"]
1718
exclude:
@@ -23,7 +24,6 @@ jobs:
2324
generator: "MinGW Makefiles"
2425
env:
2526
YAML_BUILD_SHARED_LIBS: ${{ matrix.build == 'shared' && 'ON' || 'OFF' }}
26-
YAML_CPP_BUILD_TESTS: 'ON'
2727
CMAKE_GENERATOR: >-
2828
${{format(matrix.generator != 'Default Generator' && '-G "{0}"' || '', matrix.generator)}}
2929
runs-on: ${{ matrix.os }}
@@ -33,16 +33,10 @@ jobs:
3333
- name: Get number of CPU cores
3434
uses: SimenB/github-actions-cpu-cores@v1
3535

36-
- name: Build
37-
shell: bash
38-
run: |
39-
cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }}
40-
cd build && cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }}
41-
4236
- name: Build Tests
4337
shell: bash
4438
run: |
45-
cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }} -DYAML_CPP_BUILD_TESTS=${{ env.YAML_CPP_BUILD_TESTS }}
39+
cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }} -DYAML_CPP_BUILD_TESTS=ON
4640
cd build && cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }}
4741
4842
- name: Run Tests

0 commit comments

Comments
 (0)