Skip to content

Commit

Permalink
add std test.
Browse files Browse the repository at this point in the history
  • Loading branch information
levalup committed Jul 1, 2024
1 parent 62ef12d commit af9051d
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-classic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ jobs:
g++ --version
- name: Configure
run: >-
cmake -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S .
run: |
mkdir -p build
pushd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DSTD=11 ..
popd
- name: Build
run: >-
cmake --build build
--config ${{ matrix.build_type }}
run: |
cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/build-gcc-std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build GCC-std

on:
push:
branches:
- master
- develop

pull_request:
branches:
- master
- develop

jobs:
build-gcc-std:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
os: [ ubuntu-latest ]
build_type: [ Release ]
std: [ '17', '14', '11' ]

name: "On ${{matrix.os}} gcc -std=c++${{matrix.std}}"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: friendlyanon/fetch-core-count@v1
id: cores

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure
run: >
cmake -B "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S "${{ github.workspace }}"
- name: Build
run: >-
cmake --build "${{ steps.strings.outputs.build-output-dir }}"
-DSTD=${{ matrix.std }}
--config ${{ matrix.build_type }}
- name: Test
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
63 changes: 63 additions & 0 deletions .github/workflows/build-msvc-std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build MSVC-std

on:
push:
branches:
- master
- develop

pull_request:
branches:
- master
- develop

jobs:
build-msvc-std:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
os: [ windows-latest ]
build_type: [ Release ]
cl: [ cl ]
std: [ '17', '14', '11' ]

name: "On ${{matrix.os}} cl -std=c++${{matrix.std}}"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: friendlyanon/fetch-core-count@v1
id: cores

- name: Set output
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure
run: >
cmake -B "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S "${{ github.workspace }}"
- name: Build
run: >-
cmake --build "${{ steps.strings.outputs.build-output-dir }}"
-DSTD=${{ matrix.std }}
-DCMAKE_CXX_COMPILER=${{ matrix.cl }}
-DCMAKE_C_COMPILER=${{ matrix.cl }}
--config ${{ matrix.build_type }}
- name: Test
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}

0 comments on commit af9051d

Please sign in to comment.