1
1
name : CMake
2
2
3
- on : [push]
3
+ on : [push, pull_request ]
4
4
5
5
env :
6
6
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
12
12
CONAN_USER_HOME_SHORT : " ${{ github.workspace }}/conan-cache/short"
13
13
14
14
jobs :
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 }}
17
31
runs-on : ${{ matrix.os }}
18
32
strategy :
19
33
fail-fast : false # 'false' means Don't stop matrix workflows even if some matrix entry fails.
20
34
matrix :
21
35
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'}
28
44
]
29
- cxx : [14, 17, 20]
45
+ cxx : [17, 20]
30
46
31
47
steps :
32
48
- uses : actions/checkout@v3
@@ -41,50 +57,27 @@ jobs:
41
57
~/.cache/pip
42
58
key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
43
59
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
-
55
60
- name : Install conan
56
61
shell : bash
57
62
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
60
64
source ~/.profile
61
65
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 }}
65
71
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 }}
78
76
79
77
- name : Build
80
- working-directory : ${{runner.workspace}}/build
81
78
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 }}
84
80
85
81
- name : Test
86
- working-directory : ${{runner.workspace}}/build
87
82
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