Skip to content

Commit 597935d

Browse files
committed
Fix for codeQL
1 parent a7b1c8a commit 597935d

File tree

2 files changed

+93
-50
lines changed

2 files changed

+93
-50
lines changed

.github/workflows/build.yaml

+83-39
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@ on:
1818
push:
1919
branches:
2020
- master
21-
- 'v*-branch'
21+
- "v*-branch"
2222
pull_request:
2323
merge_group:
2424
workflow_dispatch:
2525
workflow_call:
26-
inputs:
27-
run-codeql:
28-
required: false
29-
type: boolean
26+
inputs:
27+
run-codeql:
28+
required: false
29+
type: boolean
3030

3131
concurrency:
32-
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
32+
group:
33+
${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name ==
34+
'pull_request' && github.event.number) || (github.event_name ==
35+
'workflow_dispatch' && github.run_number) || github.sha }}
3336
cancel-in-progress: true
3437

3538
env:
@@ -47,7 +50,8 @@ jobs:
4750
volumes:
4851
- "/:/runner-root-volume"
4952
- "/tmp/log_output:/tmp/test_logs"
50-
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
53+
options:
54+
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
5155
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
5256

5357
steps:
@@ -57,26 +61,34 @@ jobs:
5761
run: echo "$GITHUB_CONTEXT"
5862
- name: Dump Concurrency context
5963
env:
60-
CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
64+
CONCURRENCY_CONTEXT:
65+
${{ github.ref }}-${{ github.workflow }}-${{
66+
(github.event_name == 'pull_request' &&
67+
github.event.number) || (github.event_name ==
68+
'workflow_dispatch' && github.run_number) || github.sha }}
6169
run: echo "$CONCURRENCY_CONTEXT"
6270
- name: Checkout
6371
uses: actions/checkout@v4
64-
- name: Try to ensure the directories for core dumping exist and we
72+
- name:
73+
Try to ensure the directories for core dumping exist and we
6574
can write them.
6675
run: |
6776
mkdir /tmp/cores || true
6877
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
6978
- name: Checkout submodules & Bootstrap
7079
uses: ./.github/actions/checkout-submodules-and-bootstrap
7180
with:
72-
platform: linux
81+
platform: linux
7382
- name: Initialize CodeQL
7483
if: ${{ inputs.run-codeql }}
7584
uses: github/codeql-action/init@v3
7685
with:
7786
languages: "cpp"
7887
- name: Setup Build
79-
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false"
88+
run:
89+
scripts/build/gn_gen.sh
90+
--args="chip_config_memory_debug_checks=true
91+
chip_config_memory_debug_dmalloc=false"
8092
- name: Run Build
8193
run: scripts/run_in_build_env.sh "ninja -C ./out"
8294
- name: Run Tests
@@ -94,11 +106,15 @@ jobs:
94106
- name: Run Build Without Detail Logging
95107
run: scripts/run_in_build_env.sh "ninja -C ./out"
96108
- name: Set up Build Without Progress Logging
97-
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false"
109+
run:
110+
scripts/build/gn_gen.sh --args="chip_detail_logging=false
111+
chip_progress_logging=false"
98112
- name: Run Build Without Progress Logging
99113
run: scripts/run_in_build_env.sh "ninja -C ./out"
100114
- name: Set up Build Without Error Logging
101-
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false"
115+
run:
116+
scripts/build/gn_gen.sh --args="chip_detail_logging=false
117+
chip_progress_logging=false chip_error_logging=false"
102118
- name: Run Build Without Error Logging
103119
run: scripts/run_in_build_env.sh "ninja -C ./out"
104120
- name: Set up Build Without Logging
@@ -117,7 +133,7 @@ jobs:
117133
if: ${{ inputs.run-codeql }}
118134
uses: ./.github/actions/perform-codeql-analysis
119135
with:
120-
language: cpp
136+
language: cpp
121137
# OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually
122138
# having the job timeout.
123139
#
@@ -143,7 +159,8 @@ jobs:
143159
volumes:
144160
- "/:/runner-root-volume"
145161
- "/tmp/log_output:/tmp/test_logs"
146-
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
162+
options:
163+
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
147164
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
148165

149166
steps:
@@ -153,22 +170,27 @@ jobs:
153170
run: echo "$GITHUB_CONTEXT"
154171
- name: Dump Concurrency context
155172
env:
156-
CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
173+
CONCURRENCY_CONTEXT:
174+
${{ github.ref }}-${{ github.workflow }}-${{
175+
(github.event_name == 'pull_request' &&
176+
github.event.number) || (github.event_name ==
177+
'workflow_dispatch' && github.run_number) || github.sha }}
157178
run: echo "$CONCURRENCY_CONTEXT"
158179
- name: Checkout
159180
uses: actions/checkout@v4
160181
with:
161182
fetch-depth: 2
162183
persist-credentials: true
163-
- name: Try to ensure the directories for core dumping exist and we
184+
- name:
185+
Try to ensure the directories for core dumping exist and we
164186
can write them.
165187
run: |
166188
mkdir /tmp/cores || true
167189
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
168190
- name: Checkout submodules & Bootstrap
169191
uses: ./.github/actions/checkout-submodules-and-bootstrap
170192
with:
171-
platform: linux
193+
platform: linux
172194
- name: Initialize CodeQL
173195
if: ${{ inputs.run-codeql }}
174196
uses: github/codeql-action/init@v3
@@ -188,6 +210,12 @@ jobs:
188210
BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh
189211
- name: Clean output
190212
run: rm -rf ./out
213+
214+
- name: Perform CodeQL Analysis
215+
if: ${{ inputs.run-codeql }}
216+
uses: ./.github/actions/perform-codeql-analysis
217+
with:
218+
language: cpp
191219
- name: Run Tests with sanitizers
192220
# Sanitizer tests are not likely to find extra issues so running the same tests
193221
# as above repeatedly on every pull request seems extra time. Instead keep this run
@@ -223,7 +251,8 @@ jobs:
223251
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
224252
# See https://github.com/llvm/llvm-project/issues/97426
225253
env:
226-
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
254+
ALL_CHANGED_FILES:
255+
${{ steps.changed-files.outputs.all_changed_files }}
227256
run: |
228257
touch out/changed_files.txt
229258
for file in ${ALL_CHANGED_FILES}; do
@@ -248,7 +277,9 @@ jobs:
248277
--target linux-x64-rpc-console \
249278
build \
250279
"
251-
- name: Create a pre-generate directory and ensure compile-time codegen would fail
280+
- name:
281+
Create a pre-generate directory and ensure compile-time
282+
codegen would fail
252283
run: |
253284
./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
254285
mv scripts/codegen.py scripts/codegen.py.renamed
@@ -264,7 +295,9 @@ jobs:
264295
--pregen-dir ./zzz_pregenerated \
265296
build \
266297
"
267-
- name: Undo code pre-generation changes (make compile time codegen work again)
298+
- name:
299+
Undo code pre-generation changes (make compile time codegen
300+
work again)
268301
run: |
269302
rm -rf ./zzz_pregenerated
270303
mv scripts/codegen.py.renamed scripts/codegen.py
@@ -273,11 +306,6 @@ jobs:
273306
run: |
274307
./scripts/run_in_build_env.sh \
275308
"./scripts/build/build_examples.py --target linux-fake-tests build"
276-
- name: Perform CodeQL Analysis
277-
if: ${{ inputs.run-codeql }}
278-
uses: ./.github/actions/perform-codeql-analysis
279-
with:
280-
language: cpp
281309
282310
- name: Uploading core files
283311
uses: actions/upload-artifact@v4
@@ -312,7 +340,8 @@ jobs:
312340
volumes:
313341
- "/:/runner-root-volume"
314342
- "/tmp/log_output:/tmp/test_logs"
315-
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
343+
options:
344+
--sysctl "net.ipv6.conf.all.disable_ipv6=0
316345
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
317346

318347
steps:
@@ -322,14 +351,18 @@ jobs:
322351
run: echo "$GITHUB_CONTEXT"
323352
- name: Dump Concurrency context
324353
env:
325-
CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
354+
CONCURRENCY_CONTEXT:
355+
${{ github.ref }}-${{ github.workflow }}-${{
356+
(github.event_name == 'pull_request' &&
357+
github.event.number) || (github.event_name ==
358+
'workflow_dispatch' && github.run_number) || github.sha }}
326359
run: echo "$CONCURRENCY_CONTEXT"
327360
- name: Checkout
328361
uses: actions/checkout@v4
329362
- name: Checkout submodules & Bootstrap
330363
uses: ./.github/actions/checkout-submodules-and-bootstrap
331364
with:
332-
platform: linux
365+
platform: linux
333366

334367
- name: Setup Build, Run Build and Run Tests
335368
run: |
@@ -364,7 +397,9 @@ jobs:
364397
python -m pip install -r scripts/setup/requirements.setuppayload.txt
365398
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
366399
- name: Run revocation set generation tests
367-
run: scripts/run_in_build_env.sh 'python3 -m unittest -v credentials/generate_revocation_set.py'
400+
run:
401+
scripts/run_in_build_env.sh 'python3 -m unittest -v
402+
credentials/generate_revocation_set.py'
368403

369404
build_linux_python_lighting_device:
370405
name: Build on Linux (python lighting-app)
@@ -377,7 +412,8 @@ jobs:
377412
volumes:
378413
- "/:/runner-root-volume"
379414
- "/tmp/log_output:/tmp/test_logs"
380-
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
415+
options:
416+
--sysctl "net.ipv6.conf.all.disable_ipv6=0
381417
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
382418

383419
steps:
@@ -387,14 +423,18 @@ jobs:
387423
run: echo "$GITHUB_CONTEXT"
388424
- name: Dump Concurrency context
389425
env:
390-
CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
426+
CONCURRENCY_CONTEXT:
427+
${{ github.ref }}-${{ github.workflow }}-${{
428+
(github.event_name == 'pull_request' &&
429+
github.event.number) || (github.event_name ==
430+
'workflow_dispatch' && github.run_number) || github.sha }}
391431
run: echo "$CONCURRENCY_CONTEXT"
392432
- name: Checkout
393433
uses: actions/checkout@v4
394434
- name: Checkout submodules & Bootstrap
395435
uses: ./.github/actions/checkout-submodules-and-bootstrap
396436
with:
397-
platform: linux
437+
platform: linux
398438

399439
- name: Setup Build
400440
run: |
@@ -414,8 +454,10 @@ jobs:
414454
- name: Checkout submodules & Bootstrap
415455
uses: ./.github/actions/checkout-submodules-and-bootstrap
416456
with:
417-
platform: darwin
418-
- name: Try to ensure the directory for diagnostic log collection exists
457+
platform: darwin
458+
- name:
459+
Try to ensure the directory for diagnostic log collection
460+
exists
419461
run: |
420462
mkdir -p ~/Library/Logs/DiagnosticReports || true
421463
- name: Initialize CodeQL
@@ -454,7 +496,8 @@ jobs:
454496
# NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check.
455497
# See https://github.com/llvm/llvm-project/issues/97426
456498
env:
457-
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
499+
ALL_CHANGED_FILES:
500+
${{ steps.changed-files.outputs.all_changed_files }}
458501
run: |
459502
touch out/changed_files.txt
460503
for file in ${ALL_CHANGED_FILES}; do
@@ -480,7 +523,7 @@ jobs:
480523
if: ${{ inputs.run-codeql }}
481524
uses: ./.github/actions/perform-codeql-analysis
482525
with:
483-
language: cpp
526+
language: cpp
484527

485528
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
486529
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
@@ -496,7 +539,8 @@ jobs:
496539
volumes:
497540
- "/:/runner-root-volume"
498541
- "/tmp/log_output:/tmp/test_logs"
499-
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
542+
options:
543+
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
500544
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
501545

502546
steps:
@@ -505,7 +549,7 @@ jobs:
505549
- name: Checkout submodules & Bootstrap
506550
uses: ./.github/actions/checkout-submodules-and-bootstrap
507551
with:
508-
platform: linux
552+
platform: linux
509553

510554
- name: Run Build Coverage
511555
run: ./scripts/build_coverage.sh

.github/workflows/codeql.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414
name: "CodeQL"
1515

1616
on:
17-
workflow_dispatch:
18-
# push:
19-
# branches: [ "master", "sve*", "test_event_*", "v1.*" ]
20-
# pull_request:
21-
schedule:
22-
- cron: '0 5 * * *'
17+
workflow_dispatch:
18+
# push:
19+
# branches: [ "master", "sve*", "test_event_*", "v1.*" ]
20+
# pull_request:
21+
schedule:
22+
- cron: "0 5 * * *"
2323

2424
jobs:
25-
analyze:
26-
uses: project-chip/connectedhomeip/.github/workflows/build.yaml@master
27-
with:
28-
run-codeql: true
29-
25+
analyze:
26+
uses: Alami-Amine/connectedhomeip/.github/workflows/build.yaml@master
27+
with:
28+
run-codeql: true

0 commit comments

Comments
 (0)