Skip to content

Commit 5ac1aef

Browse files
committed
github action: move the fuzzing action into it own file/task
1 parent c53ca6d commit 5ac1aef

File tree

2 files changed

+64
-50
lines changed

2 files changed

+64
-50
lines changed

.github/workflows/CICD.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -125,56 +125,6 @@ jobs:
125125
S=$(cargo fmt -- --check) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s\n" "$S" | sed -E -n -e "s/^Diff[[:space:]]+in[[:space:]]+${PWD//\//\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*$/::${fault_type} file=\1,line=\2::${fault_prefix}: \`cargo fmt\`: style violation (file:'\1', line:\2; use \`cargo fmt -- \"\1\"\`)/p" ; fault=true ; }
126126
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
127127
128-
fuzz:
129-
name: Run the fuzzers
130-
runs-on: ubuntu-latest
131-
env:
132-
RUN_FOR: 60
133-
steps:
134-
- uses: actions/checkout@v4
135-
- uses: dtolnay/rust-toolchain@nightly
136-
- name: Install `cargo-fuzz`
137-
run: cargo install cargo-fuzz
138-
- uses: Swatinem/rust-cache@v2
139-
- name: Run fuzz_date for XX seconds
140-
shell: bash
141-
run: |
142-
## Run it
143-
cd fuzz
144-
cargo +nightly fuzz run fuzz_date -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
145-
- name: Run fuzz_test for XX seconds
146-
continue-on-error: true
147-
shell: bash
148-
run: |
149-
## Run it
150-
cd fuzz
151-
cargo +nightly fuzz run fuzz_test -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
152-
- name: Run fuzz_expr for XX seconds
153-
continue-on-error: true
154-
shell: bash
155-
run: |
156-
## Run it
157-
cd fuzz
158-
cargo +nightly fuzz run fuzz_expr -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
159-
- name: Run fuzz_parse_glob for XX seconds
160-
shell: bash
161-
run: |
162-
## Run it
163-
cd fuzz
164-
cargo +nightly fuzz run fuzz_parse_glob -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
165-
- name: Run fuzz_parse_size for XX seconds
166-
shell: bash
167-
run: |
168-
## Run it
169-
cd fuzz
170-
cargo +nightly fuzz run fuzz_parse_size -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
171-
- name: Run fuzz_parse_time for XX seconds
172-
shell: bash
173-
run: |
174-
## Run it
175-
cd fuzz
176-
cargo +nightly fuzz run fuzz_parse_time -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
177-
178128
style_lint:
179129
name: Style/lint
180130
runs-on: ${{ matrix.job.os }}

.github/workflows/fuzzing.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Fuzzing
2+
3+
# spell-checker:ignore fuzzer
4+
5+
on: [push, pull_request]
6+
7+
permissions:
8+
contents: read # to fetch code (actions/checkout)
9+
10+
# End the current execution if there is a new changeset in the PR.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
14+
15+
jobs:
16+
fuzz:
17+
name: Run the fuzzers
18+
runs-on: ubuntu-latest
19+
env:
20+
RUN_FOR: 60
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@nightly
24+
- name: Install `cargo-fuzz`
25+
run: cargo install cargo-fuzz
26+
- uses: Swatinem/rust-cache@v2
27+
- name: Run fuzz_date for XX seconds
28+
shell: bash
29+
run: |
30+
## Run it
31+
cd fuzz
32+
cargo +nightly fuzz run fuzz_date -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
33+
- name: Run fuzz_test for XX seconds
34+
continue-on-error: true
35+
shell: bash
36+
run: |
37+
## Run it
38+
cd fuzz
39+
cargo +nightly fuzz run fuzz_test -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
40+
- name: Run fuzz_expr for XX seconds
41+
continue-on-error: true
42+
shell: bash
43+
run: |
44+
## Run it
45+
cd fuzz
46+
cargo +nightly fuzz run fuzz_expr -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
47+
- name: Run fuzz_parse_glob for XX seconds
48+
shell: bash
49+
run: |
50+
## Run it
51+
cd fuzz
52+
cargo +nightly fuzz run fuzz_parse_glob -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
53+
- name: Run fuzz_parse_size for XX seconds
54+
shell: bash
55+
run: |
56+
## Run it
57+
cd fuzz
58+
cargo +nightly fuzz run fuzz_parse_size -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
59+
- name: Run fuzz_parse_time for XX seconds
60+
shell: bash
61+
run: |
62+
## Run it
63+
cd fuzz
64+
cargo +nightly fuzz run fuzz_parse_time -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0

0 commit comments

Comments
 (0)