mirror of
https://github.com/tree-sitter/fuzz-action.git
synced 2026-11-17 03:00:40 +00:00
Input fuzzing action for tree-sitter parsers
- Perl 49.2%
- Makefile 33.9%
- C 16.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .editorconfig | ||
| .gitignore | ||
| action.yml | ||
| annotate.pl | ||
| fuzzer.c | ||
| ignorelist.ini | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Tree-sitter parser fuzzing
Important
This only works on Linux.
Options
directory:
description: The directory of the grammar
corpus:
description: The directory of the seed corpus
timeout:
description: The time to wait if the fuzzer hangs
default: 10
max-time:
description: The maximum total fuzzing time
default: 60
max-length:
description: The maximum fuzz input length
default: 4096
tree-sitter-version:
description: The tree-sitter version to install
default: latest
Example configuration
name: Fuzz parser
on:
push:
branches: [master]
paths:
- src/scanner.c
pull_request:
paths:
- src/scanner.c
jobs:
test:
name: Parser fuzzing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tree-sitter/fuzz-action@v4
Using locally
Requirements
pkg-configmakejqllvmtree-sitterlibrary
Usage
make LANG_NAME=parser LANG_DIR=/path/to/tree-sitter-parser
Tip
Check the Makefile for more options.
Credits
Based on vigoux/tree-sitter-fuzz-action