ci: Pin Rust Version, don't use Nightly rustfmt
features, fix Fuzz workflow
#2783
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'compact_str/**' | |
- 'fuzz/**' | |
- '.github/workflows/fuzz.yml' | |
- '!CHANGELOG.md' | |
- '!**/README.md' | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 01,13 * * *' | |
name: Fuzz | |
env: | |
CARGO_TERM_COLOR: "always" | |
RUSTFLAGS: "-D warnings -Zrandomize-layout" | |
jobs: | |
libFuzzer_x86_64: | |
name: libFuzzer [x86_64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout compact_str | |
- name: Install toolchain | |
run: | | |
rustup toolchain install nightly-2024-06-01 --no-self-update | |
rustup override set nightly-2024-06-01 | |
rustup target add x86_64-unknown-linux-musl | |
- name: Install cargo-fuzz | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-fuzz | |
- uses: Swatinem/rust-cache@v2 | |
- name: Set Fuzz Time | |
run: | | |
if [[ "${{github.event_name}}" == "push" || "${{github.event_name}}" == "pull_request" ]]; then | |
echo "fuzz_time=120" >> $GITHUB_ENV | |
else | |
echo "fuzz_time=1800" >> $GITHUB_ENV | |
fi | |
echo "${{ env.fuzz_time }}" | |
- name: Fuzz! | |
run: cargo fuzz run --features=libfuzzer-sys --debug-assertions compact_str -- -max_total_time=${{ env.fuzz_time }} | |
# - name: File Issue (if failure found) | |
# if: failure() | |
# uses: JasonEtco/create-an-issue@v2.9 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# update_existing: true |