forked from Diggsey/ijson
-
Notifications
You must be signed in to change notification settings - Fork 0
MOD-12261 add CI + fuzz tests #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AvivDavid23
wants to merge
21
commits into
master
Choose a base branch
from
MOD-12261-add-ci-test-for-ijeson-fazzer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d690d2a
initial fuzz target
AvivDavid23 2ae12e3
simple test + ci files
AvivDavid23 ab64488
test
AvivDavid23 dbbcc29
test
AvivDavid23 a65efd6
project structure
AvivDavid23 a91e221
project structure
AvivDavid23 5dade0d
project structure
AvivDavid23 123da85
fix
AvivDavid23 b215cf2
remove toolchain
AvivDavid23 71bbf38
ci
AvivDavid23 0669e74
ci
AvivDavid23 c6dabbd
ci
AvivDavid23 0a54aa6
fix
AvivDavid23 543065b
test
AvivDavid23 76e1adc
fix
AvivDavid23 e864539
fix
AvivDavid23 ad754fb
change to randomise json de
AvivDavid23 3981302
remove print
AvivDavid23 19b5378
fix strings
AvivDavid23 44b5a5b
remove print, again
AvivDavid23 b362ba7
fix
AvivDavid23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Event CI | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build_and_test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Toolchain | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: stable | ||
| override: true | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Cargo Format | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: fmt | ||
| args: -- --check | ||
|
|
||
| - name: Clippy | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: clippy | ||
| args: --all-features -- -D warnings | ||
|
|
||
| - name: Build | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: build | ||
| args: --release --all-features | ||
|
|
||
| - name: Test | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: test | ||
| args: -- --test-threads=1 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Smoke-Test Fuzz Targets | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| fuzz: | ||
| env: | ||
| CARGO_FUZZ_VERSION: 0.13.0 | ||
| FUZZ_TIME: 180 | ||
|
|
||
| strategy: | ||
| matrix: | ||
| include: | ||
| - fuzz_target: fuzz_string | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Setup | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: nightly | ||
| override: true | ||
| components: cargo-fuzz | ||
|
|
||
| - uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: install | ||
| args: cargo-fuzz --version ${{ env.CARGO_FUZZ_VERSION }} | ||
|
|
||
| - name: Fuzz | ||
| working-directory: fuzz | ||
| run: cargo fuzz run ${{ matrix.fuzz_target }} --release -- -max_total_time=${{ env.FUZZ_TIME }} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| target | ||
| corpus | ||
| artifacts | ||
| coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| [package] | ||
| name = "ijson-fuzz" | ||
| version = "0.0.0" | ||
| publish = false | ||
| edition = "2021" | ||
|
|
||
| [package.metadata] | ||
| cargo-fuzz = true | ||
|
|
||
| [dependencies] | ||
| libfuzzer-sys = "0.4" | ||
| arbitrary = { version = "1.3", features = ["derive"] } | ||
| serde = { workspace = true } | ||
| serde_json = { workspace = true } | ||
|
|
||
| [dependencies.ijson] | ||
| path = ".." | ||
|
|
||
| [[bin]] | ||
| name = "fuzz_string" | ||
| path = "fuzz_targets/fuzz_string.rs" | ||
| test = false | ||
| doc = false | ||
| bench = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #![no_main] | ||
|
|
||
| use ijson::IValue; | ||
| use libfuzzer_sys::fuzz_target; | ||
| use serde::Deserialize; | ||
|
|
||
| fuzz_target!(|data: &str| { | ||
| if data.is_empty() { | ||
| return; | ||
| } | ||
| let mut deserializer = serde_json::Deserializer::from_str(data); | ||
| let _ = IValue::deserialize(&mut deserializer); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [toolchain] | ||
| channel = "nightly" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.