11name : CMake
22
3- on : [push]
3+ on : [push, pull_request ]
44
55env :
66 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1212 CONAN_USER_HOME_SHORT : " ${{ github.workspace }}/conan-cache/short"
1313
1414jobs :
15- build :
16- name : ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }}
15+ docker :
16+ name : Test docker images
17+ runs-on : ubuntu-22.04
18+ steps :
19+ - uses : actions/checkout@v3
20+
21+ - name : Build docker-ci image
22+ shell : bash
23+ run : cd docker && ./build-ci-image.sh
24+
25+ - name : Build docker-dev image
26+ shell : bash
27+ run : cd docker && ./build-dev-image.sh
28+
29+ linux :
30+ name : ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }}, ${{ matrix.buildtype }}
1731 runs-on : ${{ matrix.os }}
1832 strategy :
1933 fail-fast : false # 'false' means Don't stop matrix workflows even if some matrix entry fails.
2034 matrix :
2135 os : [ubuntu-22.04]
22- compiler : [ {name: 'GCC 10', cpp: g++-10, c: gcc-10, pkgs: 'gcc-10 g++-10 lib32gcc-10-dev gcc-multilib'},
23- {name: 'GCC 11', cpp: g++-11, c: gcc-11, pkgs: 'gcc-11 g++-11 lib32gcc-11-dev gcc-multilib'},
24- {name: 'Clang 12', cpp: clang++-12, c: clang-12, pkgs: 'clang-12 llvm-12'},
25- {name: 'Clang 13', cpp: clang++-13, c: clang-13, pkgs: 'clang-13 llvm-13'},
26- {name: 'Clang 14', cpp: clang++-14, c: clang-14, pkgs: 'clang-14 llvm-14'},
27- {name: 'Clang 15', cpp: clang++-15, c: clang-15, pkgs: 'clang-15 llvm-15'}
36+ buildtype : [debug]
37+ compiler : [ {name: 'GCC 10', preset: gcc-10, pkgs: 'gcc-10 g++-10 lib32gcc-10-dev gcc-multilib'},
38+ {name: 'GCC 11', preset: gcc-11, pkgs: 'gcc-11 g++-11 lib32gcc-11-dev gcc-multilib'},
39+ {name: 'GCC 12', preset: gcc-12, pkgs: 'gcc-12 g++-12 lib32gcc-12-dev gcc-multilib'},
40+ {name: 'Clang 12', preset: clang-12, pkgs: 'clang-12 llvm-12'},
41+ {name: 'Clang 13', preset: clang-13, pkgs: 'clang-13 llvm-13'},
42+ {name: 'Clang 14', preset: clang-14, pkgs: 'clang-14 llvm-14'},
43+ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'}
2844 ]
29- cxx : [14, 17, 20]
45+ cxx : [17, 20]
3046
3147 steps :
3248 - uses : actions/checkout@v3
@@ -41,50 +57,27 @@ jobs:
4157 ~/.cache/pip
4258 key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
4359
44- - name : Create Build Environment
45- # Some projects don't allow in-source building, so create a separate build directory
46- # We'll use this as our working directory for all subsequent commands
47- run : cmake -E make_directory ${{runner.workspace}}/build
48-
49- - run : |
50- sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
51- sudo apt update
52- sudo apt install ${{ matrix.compiler.pkgs }}
53- shell: bash
54-
5560 - name : Install conan
5661 shell : bash
5762 run : |
58- python3 -m pip install --upgrade pip setuptools
59- python3 -m pip install conan
63+ python3 -m pip install --upgrade pip setuptools conan==1.59
6064 source ~/.profile
6165
62- - name : Configure CMake
63- # Use a bash shell so we can use the same syntax for environment variable
64- # access regardless of the host operating system
66+ - name : Install dependencies
67+ run : |
68+ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
69+ sudo apt update
70+ sudo apt install ninja-build ${{ matrix.compiler.pkgs }}
6571 shell : bash
66- working-directory : ${{runner.workspace}}/build
67- env :
68- CC : ${{ matrix.compiler.c }}
69- CXX : ${{ matrix.compiler.cpp }}
70- # Note the current convention is to use the -S and -B options here to specify source
71- # and build directories, but this is only available with CMake 3.13 and higher.
72- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
73- #
74- # We need to source the profile file to make sure conan is in PATH
75- run : |
76- source ~/.profile
77- cmake $GITHUB_WORKSPACE -DCXX_STANDARD=${{ matrix.cxx }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPP_STARTER_USE_SML=ON -DCPP_STARTER_USE_BOOST_BEAST=ON -DCPP_STARTER_USE_CROW=ON -DCPP_STARTER_USE_CPPZMQ_PROTO=ON
72+
73+ - name : Configure via CMake
74+ shell : bash
75+ run : cmake --preset unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} -DCXX_STANDARD=${{ matrix.cxx }}
7876
7977 - name : Build
80- working-directory : ${{runner.workspace}}/build
8178 shell : bash
82- # Execute the build. You can specify a specific target with "--target <NAME>"
83- run : cmake --build . --config $BUILD_TYPE
79+ run : cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}
8480
8581 - name : Test
86- working-directory : ${{runner.workspace}}/build
8782 shell : bash
88- # Execute tests defined by the CMake configuration.
89- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
90- run : ctest -C $BUILD_TYPE
83+ run : ctest --preset test-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}
0 commit comments