Skip to content

Commit

Permalink
Merge pull request #396 from mgeisler/cache-build-tools
Browse files Browse the repository at this point in the history
Cache cargo-fuzz between invocations
  • Loading branch information
mgeisler committed Jun 27, 2021
2 parents f2de8de + e9726a0 commit 8222afa
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,41 @@ jobs:
- name: Install nightly Rust
run: rustup default nightly

- name: Get latest cargo-fuzz version
id: cargo-fuzz-version
run: |
VERSION=$(cargo search cargo-fuzz | grep cargo-fuzz | cut -d '"' -f 2)
echo "::set-output name=version::$VERSION"
- name: Cache cargo-fuzz
id: cache
uses: actions/cache@v2
with:
path: ~/.cargo/bin/cargo-fuzz
key: cargo-fuzz-${{ steps.cargo-fuzz-version.outputs.version }}

- name: Install cargo-fuzz
if: steps.cache.outputs.cache-hit != 'true'
run: cargo install cargo-fuzz

- name: 30 second fuzz test
- name: Cache fuzz corpus
id: cache-fuzz-corpus
uses: actions/cache@v2
with:
path: fuzz/corpus
key: fuzz-corpus-${{ github.run_id }}
restore-keys: |
fuzz-corpus-
- name: Build fuzz targets
run: cargo fuzz build fill_first_fit

- name: Fuzz test
run: cargo fuzz run fill_first_fit -- -max_total_time=30

- name: Minimize fuzz corpus
run: cargo fuzz cmin fill_first_fit

wasm-build:
name: Build Wasm demo
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8222afa

Please sign in to comment.