Skip to content

Commit dbed744

Browse files
authored
ci: add CodeQl and only run CI on code changes
This adds CodeQL for Rust scanning. TIL about `paths-ignore` in GitHub Actions that allows us to not run all CI on any small change like README or the book. Great! Also removed some JSON file that was checked in before by mistake.
1 parent 4814b99 commit dbed744

File tree

7 files changed

+184
-2
lines changed

7 files changed

+184
-2
lines changed

.github/workflows/benchmarks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,36 @@ name: Benchmarks
33
on:
44
push:
55
branches: [ "main" ]
6+
paths-ignore:
7+
- '.clusterfuzzlite/**'
8+
- '.codeql/**'
9+
- '.github/internal_templates/**'
10+
- '.github/ISSUE_TEMPLATE/**'
11+
- '.github/dependabot.yml'
12+
- '**/.vscode/**'
13+
- '**/*.code-workspace'
14+
- '**/LICENSE'
15+
- '**/cliff.toml'
16+
- '**/*.md'
17+
- 'book/**'
18+
- 'img/**'
19+
- 'pdf/**'
620
pull_request:
721
branches: [ "main" ]
22+
paths-ignore:
23+
- '.clusterfuzzlite/**'
24+
- '.codeql/**'
25+
- '.github/internal_templates/**'
26+
- '.github/ISSUE_TEMPLATE/**'
27+
- '.github/dependabot.yml'
28+
- '**/.vscode/**'
29+
- '**/*.code-workspace'
30+
- '**/LICENSE'
31+
- '**/cliff.toml'
32+
- '**/*.md'
33+
- 'book/**'
34+
- 'img/**'
35+
- 'pdf/**'
836

937
env:
1038
CARGO_TERM_COLOR: always

.github/workflows/clusterfuzzlite-batch.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
sanitizer: ${{ matrix.sanitizer }}
5555
output-sarif: true
5656
storage-repo: https://${{ secrets.CLUSTERFUZZLITE_STORAGE_TOKEN }}@github.com/rsonquery/rsonpath-fuzz-storage.git
57+
parallel-fuzzing: true
58+
report-timeouts: true
59+
report-ooms: true
60+
report-unreproducible-crashes: true
5761

5862
ReportCrash:
5963
runs-on: ubuntu-latest

.github/workflows/clusterfuzzlite-pr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,34 @@ on:
44
workflow_dispatch:
55
push:
66
branches: ["main"]
7+
paths-ignore:
8+
- '.codeql/**'
9+
- '.github/internal_templates/**'
10+
- '.github/ISSUE_TEMPLATE/**'
11+
- '.github/dependabot.yml'
12+
- '**/.vscode/**'
13+
- '**/*.code-workspace'
14+
- '**/LICENSE'
15+
- '**/cliff.toml'
16+
- '**/*.md'
17+
- 'book/**'
18+
- 'img/**'
19+
- 'pdf/**'
720
pull_request:
821
branches: ["main"]
22+
paths-ignore:
23+
- '.codeql/**'
24+
- '.github/internal_templates/**'
25+
- '.github/ISSUE_TEMPLATE/**'
26+
- '.github/dependabot.yml'
27+
- '**/.vscode/**'
28+
- '**/*.code-workspace'
29+
- '**/LICENSE'
30+
- '**/cliff.toml'
31+
- '**/*.md'
32+
- 'book/**'
33+
- 'img/**'
34+
- 'pdf/**'
935

1036
permissions:
1137
contents: read

.github/workflows/codeql.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
name: "CodeQL Advanced"
8+
9+
on:
10+
push:
11+
branches: [ "main" ]
12+
paths-ignore:
13+
- '.clusterfuzzlite/**'
14+
- '.github/internal_templates/**'
15+
- '.github/ISSUE_TEMPLATE/**'
16+
- '.github/dependabot.yml'
17+
- '**/.vscode/**'
18+
- '**/*.code-workspace'
19+
- '**/LICENSE'
20+
- '**/cliff.toml'
21+
- '**/*.md'
22+
- 'book/**'
23+
- 'img/**'
24+
- 'pdf/**'
25+
pull_request:
26+
branches: [ "main" ]
27+
paths-ignore:
28+
- '.clusterfuzzlite/**'
29+
- '.github/internal_templates/**'
30+
- '.github/ISSUE_TEMPLATE/**'
31+
- '.github/dependabot.yml'
32+
- '**/.vscode/**'
33+
- '**/*.code-workspace'
34+
- '**/LICENSE'
35+
- '**/cliff.toml'
36+
- '**/*.md'
37+
- 'book/**'
38+
- 'img/**'
39+
- 'pdf/**'
40+
workflow_dispatch:
41+
42+
jobs:
43+
analyze:
44+
name: Analyze Rust
45+
# Runner size impacts CodeQL analysis time. To learn more, please see:
46+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
47+
# - https://gh.io/supported-runners-and-hardware-resources
48+
# - https://gh.io/using-larger-runners (GitHub.com only)
49+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
50+
runs-on: 'ubuntu-latest'
51+
permissions:
52+
# required for all workflows
53+
security-events: write
54+
55+
# required to fetch internal or private CodeQL packs
56+
packages: read
57+
58+
# only required for workflows in private repositories
59+
actions: read
60+
contents: read
61+
62+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
63+
# Use `c-cpp` to analyze code written in C, C++ or both
64+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
65+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
66+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
67+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
68+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
69+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
73+
74+
# Add any setup steps before running the `github/codeql-action/init` action.
75+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
76+
# or others). This is typically only required for manual builds.
77+
# - name: Setup runtime (example)
78+
# uses: actions/setup-example@v1
79+
80+
# Initializes the CodeQL tools for scanning.
81+
- name: Initialize CodeQL
82+
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
83+
with:
84+
languages: rust
85+
build-mode: none
86+
# If you wish to specify custom queries, you can do so here or in a config file.
87+
# By default, queries listed here will override any specified in a config file.
88+
# Prefix the list here with "+" to use these queries and those in the config file.
89+
90+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
91+
# queries: security-extended,security-and-quality
92+
93+
- name: Perform CodeQL Analysis
94+
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
95+
with:
96+
category: "/language:rust"

.github/workflows/rust.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,36 @@ on:
44
workflow_dispatch:
55
push:
66
branches: ["main"]
7+
paths-ignore:
8+
- '.clusterfuzzlite/**'
9+
- '.codeql/**'
10+
- '.github/internal_templates/**'
11+
- '.github/ISSUE_TEMPLATE/**'
12+
- '.github/dependabot.yml'
13+
- '**/.vscode/**'
14+
- '**/*.code-workspace'
15+
- '**/LICENSE'
16+
- '**/cliff.toml'
17+
- '**/*.md'
18+
- 'book/**'
19+
- 'img/**'
20+
- 'pdf/**'
721
pull_request:
822
branches: ["main"]
23+
paths-ignore:
24+
- '.clusterfuzzlite/**'
25+
- '.codeql/**'
26+
- '.github/internal_templates/**'
27+
- '.github/ISSUE_TEMPLATE/**'
28+
- '.github/dependabot.yml'
29+
- '**/.vscode/**'
30+
- '**/*.code-workspace'
31+
- '**/LICENSE'
32+
- '**/cliff.toml'
33+
- '**/*.md'
34+
- 'book/**'
35+
- 'img/**'
36+
- 'pdf/**'
937

1038
permissions:
1139
contents: read

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target/*
22
/.vscode/*.log
3-
/.idea
3+
/.idea
4+
/.codeql/database

profile.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)