-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (63 loc) · 2.46 KB
/
Copy pathci-sdk-cpp.yml
File metadata and controls
72 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI - C++ SDK
on:
workflow_dispatch:
push:
branches: [main]
paths: ["sdks/cpp/**", ".github/workflows/ci-sdk-cpp.yml"]
pull_request:
branches: [main]
paths: ["sdks/cpp/**", ".github/workflows/ci-sdk-cpp.yml"]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
VCPKG_COMMIT: 66c0373dc7fca549e5803087b9487edfe3aca0a1
jobs:
test:
runs-on: ubuntu-latest
# vcpkg 依赖安装 + 全量编译 + 585 测试 + 覆盖率:常态 ~10-14 分钟,
# 新增依赖(zlib)触发 manifest 重装时逼近 15 分钟,留足余量。
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ lcov ninja-build
- name: Configure CMake
working-directory: sdks/cpp
run: >
cmake --preset linux-x64-debug-tests-vcpkg
-DCMAKE_CXX_FLAGS="--coverage"
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"
- name: Build
working-directory: sdks/cpp
run: cmake --build --preset linux-x64-debug-tests
- name: Test
working-directory: sdks/cpp
# until-pass:3 吸收 CI runner glibc 2.39 的 tpp.c 断言回归
#(condvar + --coverage 插桩时序触发,本地高版本 glibc 不复现);
# 确定性失败重试 3 次仍红。
run: ctest --test-dir build/linux-x64-debug-tests-vcpkg --output-on-failure --repeat until-pass:3
- name: Generate coverage
working-directory: sdks/cpp
run: |
lcov --capture \
--directory build/linux-x64-debug-tests-vcpkg \
--output-file build/linux-x64-debug-tests-vcpkg/coverage.raw.info \
--ignore-errors mismatch,source,gcov,negative
lcov --remove build/linux-x64-debug-tests-vcpkg/coverage.raw.info \
'/usr/*' \
'*/vcpkg_installed/*' \
'*/build/*' \
'*/tests/*' \
'*/generated/*' \
--output-file build/linux-x64-debug-tests-vcpkg/coverage.info \
--ignore-errors unused
lcov --list build/linux-x64-debug-tests-vcpkg/coverage.info
- name: Upload coverage
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: sdks/cpp/build/linux-x64-debug-tests-vcpkg/coverage.info
flags: cpp-sdk
disable_search: true