1- # https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
21name : build
32
43on :
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
1322jobs :
14- build :
23+ test :
1524 name : ${{ matrix.config.name }}
1625 runs-on : ${{ matrix.config.os }}
1726
@@ -23,65 +32,78 @@ 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
63- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -Dcpp_channel_build_examples=ON -Dcpp_channel_build_tests=ON
60+ 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+ run : cmake --build . --config ${{ matrix.config.build_type }} --target examples
73+
74+ coverage :
75+ name : Coverage
76+ runs-on : ubuntu-latest
77+
78+ steps :
79+ - uses : actions/checkout@v4
80+
81+ - name : Create Build Environment
82+ run : cmake -E make_directory ${{github.workspace}}/build
83+
84+ - name : Configure CMake
85+ working-directory : ${{github.workspace}}/build
86+ run : cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -Dcpp_channel_build_tests=ON
87+
88+ - name : Build
89+ working-directory : ${{github.workspace}}/build
90+ run : cmake --build . --config Debug --target tests
91+
92+ - name : Test
93+ working-directory : ${{github.workspace}}/build
94+ run : ctest -C Debug --verbose -R channel_test11
95+
7896 - name : Upload coverage reports to Codecov
79978098 with :
8199 token : ${{ secrets.CODECOV_TOKEN }}
82- if : matrix.config.coverage == true
83100
84- - name : Run examples
85- working-directory : ${{github.workspace}}/build
86- shell : bash
87- run : cmake --build . --config ${{ matrix.config.build_type }} --target examples
101+ clang-format :
102+ name : Clang Format
103+ runs-on : ubuntu-latest
104+
105+ steps :
106+ - uses : actions/checkout@v4
107+
108+ - name : Run Clang Format
109+ run : clang-format --dry-run --Werror $(find include -type f)
0 commit comments