Skip to content

Commit 5169a78

Browse files
Split CI jobs
1 parent ee2c08d commit 5169a78

File tree

1 file changed

+40
-21
lines changed

1 file changed

+40
-21
lines changed

.github/workflows/cmake.yml

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
# https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
21
name: build
32

43
on:
54
push:
65
branches:
76
- master
7+
paths-ignore:
8+
- '.vscode/**'
9+
- 'LICENSE'
10+
- 'README.md'
811
pull_request:
12+
paths-ignore:
13+
- '.vscode/**'
14+
- 'LICENSE'
15+
- 'README.md'
916
workflow_dispatch:
10-
schedule:
11-
- cron: '0 18 1 * *'
17+
18+
env:
19+
CTEST_OUTPUT_ON_FAILURE: ON
20+
CTEST_PARALLEL_LEVEL: 2
1221

1322
jobs:
14-
build:
23+
test:
1524
name: ${{ matrix.config.name }}
1625
runs-on: ${{ matrix.config.os }}
1726

@@ -23,58 +32,68 @@ jobs:
2332
name: "Ubuntu Latest GCC (Release)",
2433
os: ubuntu-latest,
2534
build_type: "Release",
26-
coverage: false,
2735
}
2836
- {
2937
name: "Ubuntu 22.04 GCC (Debug)",
3038
os: ubuntu-22.04,
3139
build_type: "Debug",
32-
coverage: true,
3340
}
3441
- {
3542
name: "macOS Latest Clang (Release)",
3643
os: macos-latest,
3744
build_type: "Release",
38-
coverage: false,
3945
}
4046
- {
4147
name: "Windows Latest (Release)",
4248
os: windows-latest,
4349
build_type: "Release",
44-
coverage: false,
4550
}
4651

4752
steps:
4853
- uses: actions/checkout@v4
4954

5055
- name: Create Build Environment
51-
# Some projects don't allow in-source building, so create a separate build directory
52-
# We'll use this as our working directory for all subsequent commands
5356
run: cmake -E make_directory ${{github.workspace}}/build
5457

5558
- name: Configure CMake
56-
# Use a bash shell so we can use the same syntax for environment variable
57-
# access regardless of the host operating system
58-
shell: bash
5959
working-directory: ${{github.workspace}}/build
60-
# Note the current convention is to use the -S and -B options here to specify source
61-
# and build directories, but this is only available with CMake 3.13 and higher.
62-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
6360
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -Dcpp_channel_build_examples=ON -Dcpp_channel_build_tests=ON
6461

6562
- name: Build
6663
working-directory: ${{github.workspace}}/build
67-
shell: bash
68-
# Execute the build. You can specify a specific target with "--target <NAME>"
6964
run: cmake --build . --config ${{ matrix.config.build_type }} --target tests
7065

7166
- name: Test
7267
working-directory: ${{github.workspace}}/build
73-
shell: bash
74-
# Execute tests defined by the CMake configuration.
75-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
7668
run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test*
7769

70+
- name: Run examples
71+
working-directory: ${{github.workspace}}/build
72+
shell: bash
73+
run: cmake --build . --config ${{ matrix.config.build_type }} --target examples
74+
75+
coverage:
76+
name: Coverage
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Create Build Environment
83+
run: cmake -E make_directory ${{github.workspace}}/build
84+
85+
- name: Configure CMake
86+
working-directory: ${{github.workspace}}/build
87+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -Dcpp_channel_build_tests=ON
88+
89+
- name: Build
90+
working-directory: ${{github.workspace}}/build
91+
run: cmake --build . --config Debug --target tests
92+
93+
- name: Test
94+
working-directory: ${{github.workspace}}/build
95+
run: ctest -C Debug --verbose -R channel_test11
96+
7897
- name: Upload coverage reports to Codecov
7998
uses: codecov/[email protected]
8099
with:

0 commit comments

Comments
 (0)