Skip to content

Commit db83930

Browse files
committed
Add cifuzz github workflow
1 parent a93905f commit db83930

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/fuzzing.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Fuzzing with CI Fuzz
2+
3+
# Runs all fuzz tests in this repository with CI Fuzz.
4+
5+
# You need to set CIFUZZ_DOWNLOAD_TOKEN as a repository secret. Get the token
6+
# from https://downloads.code-intelligence.com/.
7+
8+
# Run workflow each time code is pushed to default branch of the repository,
9+
# for every pull request to the default branch and on a schedule. Allow to
10+
# run this workflow manually.
11+
# The scheduled workflow runs every day at 03:50 UTC.
12+
on:
13+
push:
14+
branches: [ $default-branch ]
15+
pull_request:
16+
branches: [ $default-branch ]
17+
schedule:
18+
- cron: '50 03 * * *'
19+
workflow_dispatch:
20+
21+
jobs:
22+
fuzz:
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
# Please comment-out the ones you don't need and uncomment the ones you do need
27+
28+
# Required to upload Findings to GitHub code scanning
29+
security-events: write
30+
31+
# Required to commit Findings to repository
32+
# contents: write
33+
34+
steps:
35+
Adapt this if you are not running on a container with Debian-based distribution
36+
- name: Install dependecies
37+
run: |
38+
sudo apt update
39+
sudo apt install curl
40+
41+
- name: Checkout repository
42+
uses: "actions/checkout@v4"
43+
44+
- name: Install CI Fuzz
45+
uses: "CodeIntelligenceTesting/actions/install-cifuzz@v1"
46+
with:
47+
version: latest
48+
download-token: ${{ secrets.CIFUZZ_DOWNLOAD_TOKEN }}
49+
50+
51+
# Needs configuration of rclone
52+
# - name: Copy corpus from cloud storage
53+
# run: |
54+
# mkdir -p .cifuzz-corpus
55+
# rclone copy -v cloud-storage:corpora/PROJECT_NAME .cifuzz-corpus
56+
57+
- name: Run fuzzing
58+
uses: "CodeIntelligenceTesting/actions/run-fuzzing@v1"
59+
with:
60+
duration: 15s
61+
62+
# Needs configuration of rclone
63+
# - name: Copy corpus to cloud storage
64+
# run: |
65+
# rclone copy -v .cifuzz-corpus cloud-storage:corpora/PROJECT_NAME
66+
67+
- name: Upload code-scanning report
68+
uses: "CodeIntelligenceTesting/actions/upload-code-scanning-report@v1"
69+
70+
# Uncomment this step if you want to commit all Findings found when running this workflow:
71+
# - name: Commit Findings to repository
72+
# run: |
73+
# git config --global user.name 'GitHub Action'
74+
# git config --global user.email 'zgtm@users.noreply.github.com'
75+
# git add .cifuzz-findings
76+
# git commit -m "Automated commit of CI Fuzz Findings"
77+
# git push
78+
79+
- name: Upload coverage report
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: cifuzz-coverage
83+
path: coverage_report
84+
85+
- name: Upload lcov report
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: cifuzz-coverage-lcov
89+
path: lcov.info
90+
91+
- name: Upload Findings report
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: cifuzz-findings
95+
path: findings.txt

0 commit comments

Comments
 (0)