Skip to content

Commit c86a294

Browse files
committed
1
1 parent 4408b52 commit c86a294

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17+
1718
# clang-format
1819
clang-format:
1920
name: clang-format
@@ -46,6 +47,9 @@ jobs:
4647
sudo apt-get update -qq
4748
sudo apt-get install -y -qq clang-tidy-18
4849
- name: Configure
50+
# 需要 compile_commands.json 给 clang-tidy 用;开 TESTS 以便 tidy 能看到测试代码的编译数据库。
51+
# 注: 本地无 catch_amalgamated 时, 开 TESTS 会触发 Catch2 下载(走根 TFL_GITHUB_MIRROR)。
52+
# CI runner 可直连 github, 正常; 若偶发因下载失败而红, 即为此处。
4953
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DTASKFLOWLITE_BUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
5054
- name: Run clang-tidy
5155
run: |
@@ -61,7 +65,13 @@ jobs:
6165
steps:
6266
- uses: actions/checkout@v4
6367
- name: Configure
68+
# 只装库: 显式关掉 examples / tests / benchmarks。
69+
# - 不编 examples: 此 job 只验证"安装 + 下游 consumer 能 find_package 链接", 编 examples 纯属浪费。
70+
# - 不编 tests: 同时避免触发 Catch2 下载(本 job 无需测试, 也不该依赖网络)。
6471
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
72+
-DTASKFLOWLITE_BUILD_EXAMPLES=OFF
73+
-DTASKFLOWLITE_BUILD_TESTS=OFF
74+
-DTASKFLOWLITE_BUILD_BENCHMARKS=OFF
6575
- name: Install
6676
run: cmake --install build
6777
- name: Verify
@@ -90,4 +100,4 @@ jobs:
90100
EOF
91101
cmake -S /tmp/test-consumer -B /tmp/test-consumer/build \
92102
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install
93-
cmake --build /tmp/test-consumer/build
103+
cmake --build /tmp/test-consumer/build

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ jobs:
2525
with:
2626
languages: cpp
2727
- name: Build
28+
# 只编库本体 + examples 供 CodeQL 扫描自有代码。
29+
# 关掉 TESTS: CodeQL 无需测试代码, 且开 TESTS 会触发下载 Catch2(第三方),
30+
# 那些源码会被一并扫描、产生与本项目无关的告警, 污染安全分析结果。
2831
run: |
29-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTASKFLOWLITE_BUILD_TESTS=ON
32+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
33+
-DTASKFLOWLITE_BUILD_EXAMPLES=ON \
34+
-DTASKFLOWLITE_BUILD_TESTS=OFF
3035
cmake --build build --parallel $(nproc)
3136
- name: Perform CodeQL Analysis
32-
uses: github/codeql-action/analyze@v3
37+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)