Skip to content

Commit

Permalink
Merge #684: Follow up from cron-daily-fuzz PR
Browse files Browse the repository at this point in the history
bd1df30 Sort fuzz files when finding (Tobin C. Harding)
73d81e5 Follow up from cron-daily-fuzz PR (Tobin C. Harding)

Pull request description:

  I royally botched up PR #683 which changed fuzzing to run daily, fix it up by doing:

  - Use the correct yaml file name in `generate-files.sh`.
  - Actually run `generate-files.sh` to generate the yaml file.
  - Fix the time UTC comment (the other times were correctly set).

ACKs for top commit:
  apoelstra:
    ACK bd1df30

Tree-SHA512: 2af4c030398a79d1de2b2b5d49a399806e21681e5783d97bc139deb6004fed6b34461fb3547070a767d6fff1f76421c775a0a7d1ddc1de05dc50a3d08682618d
  • Loading branch information
apoelstra committed May 14, 2024
2 parents 15ddc86 + bd1df30 commit 351ffa8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
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

0 comments on commit 351ffa8

Please sign in to comment.