Skip to content

Commit 2d46a43

Browse files
authored
🧪 CI: Add fuzzing workflow for PRs (#262)
This action runs fuzzing for a brief period of time, only against the actual code added in the PR. It is intended as a relatively quick check, to guard against code introducing crashes in the Markdown parsing, which should in principle always run against any text input. See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/#how-it-works
1 parent e717248 commit 2d46a43

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/fuzz.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: fuzzing
2+
3+
# This action runs fuzzing for a brief period of time,
4+
# only aginst the actual code added in the PR.
5+
# It is intended a relatively quick check,
6+
# to guard against code introducing crashes in the Markdown parsing,
7+
# which should in principle always run against any text input.
8+
# See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/#how-it-works
9+
10+
on:
11+
pull_request:
12+
13+
jobs:
14+
Fuzzing:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Build Fuzzers
18+
id: build
19+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
20+
with:
21+
oss-fuzz-project-name: 'markdown-it-py'
22+
language: python
23+
- name: Run Fuzzers
24+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
25+
with:
26+
oss-fuzz-project-name: 'markdown-it-py'
27+
language: python
28+
fuzz-seconds: 60
29+
- name: Upload Crash
30+
uses: actions/upload-artifact@v3
31+
if: failure() && steps.build.outcome == 'success'
32+
with:
33+
name: artifacts
34+
path: ./out/artifacts

.github/workflows/tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
flags: pytests
5555
file: ./coverage.xml
5656
fail_ci_if_error: true
57+
token: ${{ secrets.CODECOV_TOKEN }}
5758

5859
test-plugins:
5960

0 commit comments

Comments
 (0)