Skip to content
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

Initial skeleton for fuzzing infrastructure #699

Merged
merged 18 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/check-fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Smoke test to build fuzz targets.
# Deserves its own action given that it depends on nightly
# and there's currently no way to define multiple toolchains through the
# `rust-toolchain.toml` configuration file.
name: Build Fuzz Targets
on:
push:
branches:
- main
pull_request:

jobs:
check-fuzz:
name: Build fuzz targets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read pinned nightly version
id: nightly_version
shell: bash
run: |
NIGHTLY_VERSION=$(cat pinned-nightly-version)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for putting this and the cargo fuzz version in a file instead of using a top-level env for both? I don't see them referenced outside this file.

Copy link
Member Author

@saulecabrera saulecabrera Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is very subjective: I feel that's easier to update the version when it's defined at the root rather than having to modify the action itself.

echo "::set-output name=nightly_version::$NIGHTLY_VERSION"

- name: Read cargo fuzz version
id: cargo_fuzz_version
shell: bash
run: |
CARGO_FUZZ_VERSION=$(cat pinned-cargo-fuzz-version)
echo "::set-output name=cargo_fuzz_version::$CARGO_FUZZ_VERSION"

- name: Install nightly
run: |
rustup install ${{ steps.nightly_version.outputs.nightly_version }}
rustup override set ${{ steps.nightly_version.outputs.nightly_version }}
rustup component add clippy

- name: Install cargo fuzz
run: cargo install cargo-fuzz --version=${{ steps.cargo_fuzz_version.outputs.cargo_fuzz_version }}

- name: Build fuzz targets
run: cargo fuzz build --dev
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ jobs:
run: cargo test --package=javy-runner

- name: Lint
run: cargo clippy --workspace --exclude=javy-cli --exclude=javy-runner --target=wasm32-wasi --all-targets -- -D warnings
run: |
cargo clippy --workspace \
--exclude=javy-cli \
--exclude=javy-runner \
--exclude=javy-fuzz \
--target=wasm32-wasi --all-targets -- -D warnings

# We need to specify a different job for linting `javy-runner` given that
# it depends on Wasmtime and Cranelift cannot be compiled to `wasm32-wasi`
Expand Down
Loading
Loading