@@ -11,127 +11,121 @@ jobs:
11
11
run :
12
12
shell : bash
13
13
strategy :
14
- fail-fast : false
14
+ # fail-fast: false
15
15
matrix :
16
- boost_version : ["1.81.0"]
17
- os : [windows-2019, windows-2022]
18
- toolset : [v142, v143]
19
- build_type : [Release]
20
- generator : ["Visual Studio 16 2019", "Visual Studio 17 2022"]
21
- config_args : [""]
22
- build_args : [""]
23
- name_args : [""]
24
- exclude :
25
- - { os: windows-2019, toolset: v143 }
26
- - { os: windows-2019, generator: "Visual Studio 17 2022" }
27
- - { os: windows-2022, generator: "Visual Studio 16 2019" }
28
- # The following combinations are not available through install-boost
29
- - { boost_version: "1.81.0", toolset: v143 }
30
-
16
+ include :
17
+ - { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Debug' }
18
+ - { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Release' }
19
+ - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Debug' }
20
+ - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Release' }
31
21
steps :
32
22
- name : Checkout
33
23
uses : actions/checkout@v3
34
- with :
35
- fetch-depth : 0
36
24
37
- - name : Add boost toolset to environment
38
- if : contains(fromJson('["1.81.0"]'), matrix.boost_version)
39
- run : echo BOOST_TOOLSET=$(echo "msvc") >> $GITHUB_ENV
25
+ - name : Install dependencies
26
+ run : choco install openssl
27
+
28
+ - name : Set up a running Redis server
29
+ run : docker run -d --name redis -p 6379:6379 redis:alpine
30
+
31
+ - name : Setup Boost
32
+ run : ./tools/ci.py install-boost --source-dir=$(pwd)
40
33
41
- # The platform_version passed to boost-install determines the msvc toolset version for which static libs are installed.
42
- - name : Add boost platform version to environment
34
+ - name : Build a Boost distribution using B2
43
35
run : |
44
- declare -A toolset_to_platform_version=( [v142]="2019" [v143]="2022" )
45
- key=$(echo "${{matrix.toolset}}")
46
- echo BOOST_PLATFORM_VERSION="${toolset_to_platform_version[$key]}" >> $GITHUB_ENV
47
-
48
- - name : Add boost install path to environment
49
- run : echo BOOST_INSTALL_PATH="${GITHUB_WORKSPACE}/boost-${{matrix.boost_version}}${BOOST_TOOLSET}${BOOST_PLATFORM_VERSION}" >> $GITHUB_ENV
50
-
51
- - name : Add build type configuration to environment
52
- run : echo BUILD_CONFIG_ARG="--config ${{matrix.build_type}}" >> $GITHUB_ENV
53
-
54
- - name : Cache Boost installation
55
- id : cache-boost
56
- uses : actions/cache@v3
57
- with :
58
- path : ${{env.BOOST_INSTALL_PATH}}
59
- key : ${{matrix.boost_version}}${{env.BOOST_TOOLSET}}${{env.BOOST_PLATFORM_VERSION}}
60
-
61
- - name : Install Boost
62
- if : steps.cache-boost.outputs.cache-hit != 'true'
63
-
64
- with :
65
- boost_version : ${{matrix.boost_version}}
66
- toolset : ${{env.BOOST_TOOLSET}}
67
- boost_install_dir : ${{env.BOOST_INSTALL_PATH}}
68
- platform_version : ${{env.BOOST_PLATFORM_VERSION}}
69
- arch : null
70
-
71
- - name : Install openssl
72
- run : choco install openssl
36
+ ./tools/ci.py build-b2-distro \
37
+ --generator "${{ matrix.generator }}"
73
38
74
- - name : Create build directory
75
- run : mkdir build
39
+ - name : Build a Boost distribution using CMake
40
+ run : |
41
+ ./tools/ci.py build-cmake-distro \
42
+ --build-type ${{ matrix.build-type }} \
43
+ --cxxstd ${{ matrix.cxxstd }} \
44
+ --generator "${{ matrix.generator }}"
45
+
46
+ - name : Run the project's tests
47
+ run : |
48
+ ./tools/ci.py run-cmake-standalone-tests \
49
+ --build-type ${{ matrix.build-type }} \
50
+ --cxxstd ${{ matrix.cxxstd }} \
51
+ --generator "${{ matrix.generator }}"
76
52
77
- - name : Configure
78
- working-directory : build
53
+ - name : Run add_subdirectory tests
79
54
run : |
80
- cmake -T "${{matrix.toolset}}" \
81
- -G "${{matrix.generator}}" \
82
- ${{matrix.config_args}} \
83
- ${BOOST_COMPILER_ARG}\
84
- "${GITHUB_WORKSPACE}"
85
- env :
86
- BOOST_ROOT : ${{env.BOOST_INSTALL_PATH}}/boost
87
-
88
- - name : Build
89
- working-directory : build
55
+ ./tools/ci.py run-cmake-add-subdirectory-tests \
56
+ --build-type ${{ matrix.build-type }} \
57
+ --generator "${{ matrix.generator }}"
58
+
59
+ - name : Run find_package tests with the built cmake distribution
60
+ run : |
61
+ ./tools/ci.py run-cmake-find-package-tests \
62
+ --build-type ${{ matrix.build-type }} \
63
+ --generator "${{ matrix.generator }}"
64
+
65
+ - name : Run find_package tests with the built b2 distribution
90
66
run : |
91
- cmake --build . ${BUILD_CONFIG_ARG} ${{matrix.build_args}}
67
+ ./tools/ci.py run-cmake-b2-find-package-tests \
68
+ --build-type ${{ matrix.build-type }} \
69
+ --generator "${{ matrix.generator }}"
92
70
93
71
posix :
94
72
defaults :
95
73
run :
96
74
shell : bash
97
75
98
76
strategy :
99
- fail-fast : false
77
+ # fail-fast: false
100
78
matrix :
101
79
include :
102
- - { toolset: gcc, compiler: g++-11, install: g++-11, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' }
103
- - { toolset: gcc, compiler: g++-11, install: g++-11, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' }
104
- - { toolset: clang, compiler: clang++-11, install: clang-11, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' }
105
- - { toolset: clang, compiler: clang++-11, install: clang-11, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' }
106
- - { toolset: clang, compiler: clang++-13, install: clang-13, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' }
107
- - { toolset: clang, compiler: clang++-13, install: clang-13, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' }
108
- - { toolset: clang, compiler: clang++-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxflags: '-std=c++17 -stdlib=libc++', ldflags: '-lc++' }
109
- - { toolset: clang, compiler: clang++-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxflags: '-std=c++20 -stdlib=libc++', ldflags: '-lc++' }
80
+ - { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' }
81
+ - { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' }
82
+ - { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' }
83
+ - { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Debug', ldflags: '' }
84
+ - { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '17', build-type: 'Release', ldflags: '' }
85
+ - { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' }
86
+ - { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', cxxflags: '-stdlib=libc++', ldflags: '-lc++' }
87
+ - { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', cxxflags: '-stdlib=libc++', ldflags: '-lc++' }
88
+ name : " ${{ matrix.toolset }} ${{ matrix.cxxstd }} ${{ matrix.build-type }} ${{ matrix.cxxflags }}"
110
89
runs-on : ${{ matrix.os }}
111
90
env :
112
- CXXFLAGS : -g -O0 ${{matrix.cxxflags}} -Wall -Wextra
91
+ CXXFLAGS : ${{matrix.cxxflags}} -Wall -Wextra
113
92
LDFLAGS : ${{matrix.ldflags}}
114
93
steps :
115
94
- name : Checkout
116
95
uses : actions/checkout@v3
117
- - name : Install CMake
118
- run : sudo apt-get -y install cmake
119
- - name : Install protobuf
120
- run : sudo apt-get -y install protobuf-compiler
121
- - name : Install compiler
122
- run : sudo apt-get install -y ${{ matrix.install }}
123
- - name : Install Redis
124
- run : sudo apt-get install -y redis-server
125
- - name : Install boost
126
-
127
- id : install-boost
128
- with :
129
- boost_version : 1.81.0
130
- platform_version : 22.04
131
- - name : Run CMake
96
+
97
+ - name : Install dependencies
98
+ run : sudo apt-get -y install cmake protobuf-compiler redis-server python3 ${{ matrix.install }}
99
+
100
+ - name : Setup Boost
101
+ run : ./tools/ci.py install-boost --source-dir=$(pwd)
102
+
103
+ - name : Build a Boost distribution using B2
104
+ run : ./tools/ci.py build-b2-distro
105
+
106
+ - name : Build a Boost distribution using CMake
107
+ run : |
108
+ ./tools/ci.py build-cmake-distro \
109
+ --build-type ${{ matrix.build-type }} \
110
+ --cxxstd ${{ matrix.cxxstd }}
111
+
112
+ - name : Run the project's tests
113
+ run : |
114
+ ./tools/ci.py run-cmake-standalone-tests \
115
+ --build-type ${{ matrix.build-type }} \
116
+ --cxxstd ${{ matrix.cxxstd }}
117
+
118
+ - name : Run add_subdirectory tests
119
+ run : |
120
+ ./tools/ci.py run-cmake-add-subdirectory-tests \
121
+ --build-type ${{ matrix.build-type }}
122
+
123
+ - name : Run find_package tests with the built cmake distribution
124
+ run : |
125
+ ./tools/ci.py run-cmake-find-package-tests \
126
+ --build-type ${{ matrix.build-type }}
127
+
128
+ - name : Run find_package tests with the built b2 distribution
132
129
run : |
133
- BOOST_ROOT=${{steps.install-boost.outputs.BOOST_ROOT}} cmake -DCMAKE_CXX_COMPILER="${{matrix.compiler}}" -DCMAKE_CXX_FLAGS="${{env.CXXFLAGS}}" -DCMAKE_EXE_LINKER_FLAGS="${{env.LDFLAGS}}"
134
- - name : Build
135
- run : make
136
- - name : Check
137
- run : ctest --output-on-failure
130
+ ./tools/ci.py run-cmake-b2-find-package-tests \
131
+ --build-type ${{ matrix.build-type }}
0 commit comments