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

Follow up from cron-daily-fuzz PR #684

Merged
merged 2 commits into from
May 14, 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
32 changes: 16 additions & 16 deletions .github/workflows/cron-daily-fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Automatically generated by fuzz/generate-files.sh
name: Fuzz

on:
push:
branches:
- master
- 'test-ci/**'
pull_request:
schedule:
# 6am every day UTC, this correlates to:
# - 11pm PDT
# - 7am CET
# - 5pm AEDT
- cron: '00 06 * * *'

jobs:
fuzz:
Expand All @@ -15,33 +15,33 @@ jobs:
strategy:
fail-fast: false
matrix:
# We only get 20 jobs at a time, we probably don't want to go
# over that limit with fuzzing because of the hour run time.
fuzz_target: [
roundtrip_semantic,
compile_descriptor,
parse_descriptor,
parse_descriptor_secret,
roundtrip_concrete,
roundtrip_descriptor,
roundtrip_miniscript_script,
roundtrip_miniscript_str,
roundtrip_descriptor,
roundtrip_concrete,
compile_descriptor,
roundtrip_semantic,
]
steps:
- name: Install test dependencies
run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-fuzz
with:
path: |
~/.cargo/bin
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.65'
override: true
profile: minimal
toolchain: '1.65.0'
- name: fuzz
run: cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
Expand Down
24 changes: 12 additions & 12 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ miniscript = { path = "..", features = [ "compiler" ] }
regex = "1.0"

[[bin]]
name = "roundtrip_semantic"
path = "fuzz_targets/roundtrip_semantic.rs"
name = "compile_descriptor"
path = "fuzz_targets/compile_descriptor.rs"

[[bin]]
name = "parse_descriptor"
Expand All @@ -28,21 +28,21 @@ name = "parse_descriptor_secret"
path = "fuzz_targets/parse_descriptor_secret.rs"

[[bin]]
name = "roundtrip_miniscript_script"
path = "fuzz_targets/roundtrip_miniscript_script.rs"

[[bin]]
name = "roundtrip_miniscript_str"
path = "fuzz_targets/roundtrip_miniscript_str.rs"
name = "roundtrip_concrete"
path = "fuzz_targets/roundtrip_concrete.rs"

[[bin]]
name = "roundtrip_descriptor"
path = "fuzz_targets/roundtrip_descriptor.rs"

[[bin]]
name = "roundtrip_concrete"
path = "fuzz_targets/roundtrip_concrete.rs"
name = "roundtrip_miniscript_script"
path = "fuzz_targets/roundtrip_miniscript_script.rs"

[[bin]]
name = "compile_descriptor"
path = "fuzz_targets/compile_descriptor.rs"
name = "roundtrip_miniscript_str"
path = "fuzz_targets/roundtrip_miniscript_str.rs"

[[bin]]
name = "roundtrip_semantic"
path = "fuzz_targets/roundtrip_semantic.rs"
6 changes: 5 additions & 1 deletion fuzz/fuzz-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

REPO_DIR=$(git rev-parse --show-toplevel)

# Sort order is effected by locale. See `man sort`.
# > Set LC_ALL=C to get the traditional sort order that uses native byte values.
export LC_ALL=C

listTargetFiles() {
pushd "$REPO_DIR/fuzz" > /dev/null || exit 1
find fuzz_targets/ -type f -name "*.rs"
find fuzz_targets/ -type f -name "*.rs" | sort
popd > /dev/null || exit 1
}

Expand Down
4 changes: 2 additions & 2 deletions fuzz/generate-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ EOF
done

# 2. Generate .github/workflows/fuzz.yml
cat > "$REPO_DIR/.github/workflows/fuzz.yml" <<EOF
cat > "$REPO_DIR/.github/workflows/cron-daily-fuzz.yml" <<EOF
# Automatically generated by fuzz/generate-files.sh
name: Fuzz
on:
schedule:
# 5am every day UTC, this correlates to:
# 6am every day UTC, this correlates to:
# - 11pm PDT
# - 7am CET
# - 5pm AEDT
Expand Down
Loading