Skip to content

Commit 69c52e7

Browse files
committed
Recovered.
1 parent 83db9ac commit 69c52e7

3 files changed

Lines changed: 326 additions & 44 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: coverage
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches:
8+
- cpp_master
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
codecov:
14+
timeout-minutes: 30
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Install build dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install g++-10 cmake lcov -y
23+
./ci/set_gcc_10.sh
24+
25+
- name: Cache boost
26+
id: cache-boost
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/boost-prefix/
30+
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
31+
32+
- name: Build boost
33+
if: steps.cache-boost.outputs.cache-hit != 'true'
34+
run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix
35+
36+
- name: Cache zlib
37+
id: cache-zlib
38+
uses: actions/cache@v3
39+
with:
40+
path: ~/zlib-prefix/
41+
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
42+
43+
- name: Build zlib
44+
if: steps.cache-zlib.outputs.cache-hit != 'true'
45+
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
46+
47+
- name: Compile tests
48+
run: |
49+
mkdir build
50+
cmake \
51+
-D MSGPACK_CXX20=ON \
52+
-D MSGPACK_32BIT=OFF \
53+
-D MSGPACK_CHAR_SIGN=signed \
54+
-D MSGPACK_USE_X3_PARSE=ON \
55+
-D MSGPACK_BUILD_EXAMPLES=ON \
56+
-D MSGPACK_BUILD_TESTS=ON \
57+
-D CMAKE_BUILD_TYPE=Debug \
58+
-D MSGPACK_GEN_COVERAGE=ON \
59+
-D MSGPACK_USE_STD_VARIANT_ADAPTOR=ON \
60+
-D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \
61+
-B build \
62+
-S . || exit 1
63+
cmake --build build --target all || exit 1
64+
ctest --test-dir build || exit 1
65+
66+
- name: Generate coverage
67+
working-directory: build
68+
run: |
69+
# Create lcov report
70+
lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch
71+
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
72+
lcov --list coverage.info # debug info
73+
- name: Upload coverage to Codecov
74+
uses: codecov/codecov-action@v5
75+
with:
76+
files: build/coverage.info
77+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/gha.yml

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches:
8+
- cpp_master
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
macos:
14+
name: ${{ format('macOS (pattern {0})', matrix.pattern) }}
15+
runs-on: macos-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
pattern: [0, 1, 2, 3, 4]
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
- name: Install Dependencies
24+
run: |
25+
brew update
26+
brew install --force llvm
27+
28+
- name: Cache boost
29+
id: cache-boost
30+
uses: actions/cache@v3
31+
with:
32+
path: ~/boost-prefix/
33+
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
34+
35+
- name: Build boost
36+
if: steps.cache-boost.outputs.cache-hit != 'true'
37+
run: ./.github/depends/boost.sh -b 64 -t clang -p $HOME/boost-prefix
38+
39+
- name: Cache zlib
40+
id: cache-zlib
41+
uses: actions/cache@v3
42+
with:
43+
path: ~/zlib-prefix/
44+
key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
45+
46+
- name: Build zlib
47+
if: steps.cache-zlib.outputs.cache-hit != 'true'
48+
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
49+
50+
- name: Build and test
51+
shell: bash
52+
run: |
53+
# default configuration - overwrite its params later depending on matrix.pattern
54+
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
55+
export ARCH=64
56+
export API_VERSION=3
57+
export CHAR_SIGN="signed"
58+
export X3_PARSE="OFF"
59+
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
60+
61+
case ${{ matrix.pattern }} in
62+
0)
63+
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
64+
;;
65+
1)
66+
export API_VERSION=1
67+
;;
68+
2)
69+
export API_VERSION=2
70+
;;
71+
3)
72+
export X3_PARSE="ON"
73+
;;
74+
4)
75+
export CHAR_SIGN="unsigned"
76+
;;
77+
esac
78+
79+
# build and test
80+
export CXX="clang++"
81+
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1
82+
83+
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
84+
85+
linux:
86+
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
87+
runs-on: ubuntu-24.04
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
92+
steps:
93+
- uses: actions/checkout@v3
94+
95+
- name: Install build dependencies
96+
shell: bash
97+
run: |
98+
sudo apt-get update
99+
sudo apt-get install g++-10 cmake valgrind -y
100+
sudo apt-get install g++-10-multilib -y # for 32-bit compile
101+
./ci/set_gcc_10.sh
102+
103+
- name: Cache boost
104+
id: cache-boost
105+
uses: actions/cache@v3
106+
with:
107+
path: ~/boost-prefix/
108+
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
109+
110+
- name: Build boost
111+
if: steps.cache-boost.outputs.cache-hit != 'true'
112+
run: ./.github/depends/boost.sh -b both -t gcc -p $HOME/boost-prefix
113+
114+
- name: Cache zlib
115+
id: cache-zlib
116+
uses: actions/cache@v3
117+
with:
118+
path: ~/zlib-prefix/
119+
key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
120+
121+
- name: Build zlib
122+
if: steps.cache-zlib.outputs.cache-hit != 'true'
123+
run: ./.github/depends/zlib.sh -b both -p $HOME/zlib-prefix
124+
125+
- name: Build and test
126+
shell: bash
127+
run: |
128+
# default configuration - overwrite its params later depending on matrix.pattern
129+
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
130+
export ARCH=64
131+
export API_VERSION=3
132+
export CHAR_SIGN="signed"
133+
export X3_PARSE="OFF"
134+
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
135+
export ACTION="ci/build_cmake.sh"
136+
137+
case ${{ matrix.pattern }} in
138+
0)
139+
export CXX="clang++"
140+
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
141+
;;
142+
1)
143+
export CXX="g++-10"
144+
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
145+
;;
146+
2)
147+
export CXX="clang++"
148+
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
149+
;;
150+
3)
151+
export CXX="g++-10"
152+
export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON"
153+
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
154+
;;
155+
4)
156+
export CXX="clang++"
157+
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
158+
export NO_BOOST="-DMSGPACK_NO_BOOST"
159+
;;
160+
5)
161+
export CXX="g++-10"
162+
export ARCH=32
163+
;;
164+
6)
165+
export CXX="clang++"
166+
export API_VERSION=2
167+
;;
168+
7)
169+
export CXX="g++-10"
170+
export API_VERSION=1
171+
;;
172+
8)
173+
export CXX="clang++"
174+
export CHAR_SIGN="unsigned"
175+
;;
176+
9)
177+
export CXX="g++-10"
178+
export X3_PARSE="ON"
179+
;;
180+
10)
181+
export CXX="clang++"
182+
export ACTION="ci/build_regression.sh"
183+
;;
184+
11)
185+
export CXX="g++-10"
186+
export ARCH=32
187+
export CHAR_SIGN="unsigned"
188+
export X3_PARSE="ON"
189+
;;
190+
esac
191+
192+
# build and test
193+
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE} ${NO_BOOST}" ci/build_cmake.sh || exit 1
194+
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
195+
196+
windows:
197+
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
198+
runs-on: windows-2022
199+
strategy:
200+
fail-fast: false
201+
matrix:
202+
# MSVC2022 only supports /std:c++14, /std:c++17 and /std:c++latest
203+
cxx: [14, 17, 20]
204+
pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"]
205+
steps:
206+
- uses: actions/checkout@v3
207+
208+
- name: Cache vcpkg dependencies
209+
id: cache-vcpkg
210+
uses: actions/cache@v3
211+
with:
212+
path: C:/vcpkg/installed/x64-windows
213+
key: ${{ runner.os }}-vcpkg-2021-08-09
214+
215+
- name: Install vcpkg dependencies
216+
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
217+
shell: powershell
218+
run: |
219+
vcpkg update
220+
vcpkg install zlib:x64-windows
221+
vcpkg install boost-assert:x64-windows boost-numeric-conversion:x64-windows boost-variant:x64-windows boost-utility:x64-windows boost-fusion:x64-windows boost-optional:x64-windows boost-predef:x64-windows boost-preprocessor:x64-windows boost-timer:x64-windows boost-test:x64-windows
222+
223+
- name: Build and test
224+
shell: powershell
225+
run: |
226+
$CPPVER="MSGPACK_CXX${{ matrix.cxx }}=ON"
227+
228+
md build
229+
cmake `
230+
-A x64 `
231+
-G "Visual Studio 17 2022" `
232+
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
233+
-D MSGPACK_BUILD_TESTS=ON `
234+
-D $CPPVER `
235+
-D CMAKE_CXX_FLAGS="${{ matrix.pp_flag }} /D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" `
236+
-B build `
237+
-S .
238+
if ($LastExitCode -ne 0) { exit $LastExitCode }
239+
240+
cmake --build build --config Release
241+
if ($LastExitCode -ne 0) { exit $LastExitCode }
242+
243+
ctest -VV --test-dir build -C Release
244+
if ($LastExitCode -ne 0) { exit $LastExitCode }

appveyor.yml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 7.0.0.{build}
22

33
branches:
44
only:
5-
- cpp_master
5+
- cpp_master
66

77
environment:
88
matrix:
@@ -36,28 +36,6 @@ build_script:
3636
md prefix
3737
cd build
3838
39-
# Debug: Check Boost directories
40-
Write-Host "=== Checking Boost installation at $env:boost_prefix ==="
41-
if (Test-Path "$env:boost_prefix") {
42-
Write-Host "Boost directory found!"
43-
Write-Host "Top-level contents:"
44-
dir $env:boost_prefix | Format-Table Name -AutoSize
45-
46-
Write-Host "=== Checking $env:boost_subdir ==="
47-
if (Test-Path "$env:boost_prefix\$env:boost_subdir") {
48-
Write-Host "Library directory found!"
49-
dir "$env:boost_prefix\$env:boost_subdir" | Select-Object -First 10
50-
} else {
51-
Write-Host "$env:boost_subdir not found"
52-
}
53-
} else {
54-
Write-Host "ERROR: Boost directory NOT found at $env:boost_prefix"
55-
}
56-
57-
Write-Host "=== Starting CMake configuration ==="
58-
59-
$ErrorActionPreference = "Continue"
60-
6139
cmake `
6240
-G $env:msvc `
6341
$env:cpp11 `
@@ -68,29 +46,12 @@ build_script:
6846
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" `
6947
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
7048
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" `
71-
.. 2>&1 | Tee-Object -Variable cmakeOutput
72-
73-
Write-Host "=== Full CMake output: ==="
74-
Write-Host $cmakeOutput
75-
76-
if ($LastExitCode -ne 0) {
77-
Write-Host "=== CMake configuration FAILED with exit code $LastExitCode ==="
78-
Write-Host "=== Checking if CMakeLists.txt exists ==="
79-
if (Test-Path "..\CMakeLists.txt") {
80-
Write-Host "CMakeLists.txt found"
81-
} else {
82-
Write-Host "CMakeLists.txt NOT found!"
83-
}
84-
Write-Host "=== Current directory: ==="
85-
Get-Location
86-
Write-Host "=== Directory contents: ==="
87-
dir
88-
exit $LastExitCode
89-
}
49+
..
50+
if ($LastExitCode -ne 0) { exit $LastExitCode }
9051
9152
cmake --build . --config Release
9253
if ($LastExitCode -ne 0) { exit $LastExitCode }
9354
9455
test_script:
95-
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
96-
- ctest -VV -C Release
56+
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
57+
- ctest -VV -C Release

0 commit comments

Comments
 (0)