Skip to content

Commit 7873bc5

Browse files
committed
Merge branch 'codeql_nobuild'
2 parents c7520cc + 8c4f36d commit 7873bc5

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# CI
1313
/.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y
14+
/.github/codeql/ @lucasssvaz
1415
/.gitlab/ @lucasssvaz
1516
/tests/ @lucasssvaz @P-R-O-C-H-Y
1617

.github/codeql/codeql-config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "CodeQL config"
2+
3+
packs:
4+
- trailofbits/cpp-queries
5+
- githubsecuritylab/codeql-cpp-queries
6+
- githubsecuritylab/codeql-python-queries
7+
8+
queries:
9+
- uses: security-extended
10+
- uses: security-and-quality
11+
12+
query-filters:
13+
- exclude:
14+
query path:
15+
- /^experimental\/.*/
16+
- exclude:
17+
tags contain:
18+
- experimental
19+
- exclude:
20+
problem.severity:
21+
- recommendation
22+
- exclude:
23+
id: tob/cpp/use-of-legacy-algorithm

.github/workflows/codeql_nobuild.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CodeQL No-Build Analysis
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 4 * * SUN"
7+
pull_request:
8+
paths:
9+
- "*.py"
10+
- "*.yml"
11+
- "*.c"
12+
- "*.h"
13+
- "*.cpp"
14+
- "*.hpp"
15+
- "*.ino"
16+
17+
jobs:
18+
codeql-analysis:
19+
name: CodeQL ${{ matrix.language }} Analysis
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
language:
24+
- python
25+
- actions
26+
- cpp
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
34+
with:
35+
languages: ${{ matrix.language }}
36+
config-file: ./.github/codeql/codeql-config.yml
37+
build-mode: none
38+
39+
- name: Process .ino files
40+
if: matrix.language == 'cpp'
41+
run: |
42+
# Find all .ino files and process them
43+
find . -name "*.ino" -type f | while read -r file; do
44+
echo "Processing $file"
45+
46+
# Create new .cpp file with Arduino.h include
47+
echo "#include <Arduino.h>" > "${file%.ino}.cpp"
48+
49+
# Append the original content
50+
cat "$file" >> "${file%.ino}.cpp"
51+
52+
# Remove the original .ino file
53+
rm "$file"
54+
55+
echo "Converted $file to ${file%.ino}.cpp"
56+
done
57+
58+
- name: Run CodeQL Analysis
59+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
60+
with:
61+
category: "Analysis: ${{ matrix.language }}"

0 commit comments

Comments
 (0)