Properly integrate Rust code checks in CI. (#20862)
- Add Rust code to the list of things that trigger actually running most of our CI on a PR. - Add a Rust job to our CodeQL workflow. - Drop a few old paths from the CI trigger list.
Austin S. Hemmelgarn committed
Sep 25, 2025 at 07:45 UTC
55959ece7b984bcfeff5b5a8ed13a777281f9291
5 files changed
+47
-8
.github/workflows/build.yml
+1
-2
@@ -48,10 +48,9 @@ jobs:
48
**/*.hh
49
**/*.in
50
**/*.patch
51
+ src/crates/
52
src/aclk/aclk-schemas/
53
src/ml/dlib/
53
- src/fluent-bit/
54
- src/web/server/h2o/libh2o/
54
files_ignore: |
55
netdata.spec.in
56
src/go/otel-collector/release-config.yaml.in
.github/workflows/checks.yml
-2
@@ -37,8 +37,6 @@ jobs:
37
**/*.patch
38
src/aclk/aclk-schemas/
39
src/ml/dlib/
40
- src/fluent-bit/
41
- src/web/server/h2o/libh2o/
40
files_ignore: |
41
netdata.spec.in
42
src/go/otel-collector/release-config.yaml.in
.github/workflows/codeql.yml
+44
@@ -22,6 +22,7 @@ jobs:
22
cpp: ${{ steps.cpp.outputs.run }}
23
python: ${{ steps.python.outputs.run }}
24
go: ${{ steps.go.outputs.run }}
25
+ rust: ${{ steps.rust.outputs.run }}
26
steps:
27
- name: Clone repository
28
uses: actions/checkout@v5
@@ -80,6 +81,19 @@ jobs:
81
else
82
echo "run=true" >> "${GITHUB_OUTPUT}"
83
fi
84
+ - name: Check for Rust changes
85
+ id: rust
86
+ run: |
87
+ if [ "${{ steps.always.outputs.run }}" = "false" ]; then
88
+ if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq 'src/crates/(*.rs|*Cargo.(toml|lock))' ; then
89
+ echo "run=true" >> "${GITHUB_OUTPUT}"
90
+ echo '::notice::Rust code has changed, need to run CodeQL.'
91
+ else
92
+ echo "run=false" >> "${GITHUB_OUTPUT}"
93
+ fi
94
+ else
95
+ echo "run=true" >> "${GITHUB_OUTPUT}"
96
+ fi
97
98
analyze-cpp:
99
name: Analyze C/C++
@@ -160,3 +174,33 @@ jobs:
174
uses: github/codeql-action/analyze@v3
175
with:
176
category: "/language:go"
177
+
178
+ analyze-rust:
179
+ name: Analyze Rust
180
+ runs-on: ubuntu-latest
181
+ needs: prepare
182
+ if: needs.prepare.outputs.rust == 'true'
183
+ strategy:
184
+ matrix:
185
+ tree:
186
+ - src/crates/jf
187
+ permissions:
188
+ security-events: write
189
+ steps:
190
+ - name: Git clone repository
191
+ uses: actions/checkout@v5
192
+ with:
193
+ submodules: recursive
194
+ fetch-depth: 0
195
+ - name: Initialize CodeQL
196
+ uses: github/codeql-action/init@v3
197
+ with:
198
+ languages: rust
199
+ - name: Autobuild
200
+ uses: github/codeql-action/autobuild@v3
201
+ with:
202
+ working-directory: ${{ matrix.tree }}
203
+ - name: Run CodeQL
204
+ uses: github/codeql-action/analyze@v3
205
+ with:
206
+ category: "/language:rust"
.github/workflows/docker.yml
+1
-2
@@ -55,10 +55,9 @@ jobs:
55
**/*.hh
56
**/*.in
57
**/*.patch
58
+ src/crates/
59
src/aclk/aclk-schemas/
60
src/ml/dlib/
60
- src/fluent-bit/
61
- src/web/server/h2o/libh2o/
61
files_ignore: |
62
netdata.spec.in
63
src/go/otel-collector/release-config.yaml.in
.github/workflows/packaging.yml
+1
-2
@@ -62,10 +62,9 @@ jobs:
62
packaging/*.sh
63
packaging/*.version
64
packaging/*.checksums
65
+ src/crates/
66
src/aclk/aclk-schemas/
67
src/ml/dlib/
67
- src/fluent-bit/
68
- src/web/server/h2o/libh2o/
68
files_ignore: |
69
src/go/otel-collector/release-config.yaml.in
70
**/*.md