# Runs on every push and pull request. Gitea Actions reads this file too # (it falls back to .github/workflows), so one definition serves both. name: ci on: push: pull_request: env: CARGO_TERM_COLOR: always # Warnings fail the build here, and only here: locally they stay warnings # so that work in progress compiles. RUSTFLAGS: -D warnings jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - name: Format run: cargo fmt --all -- --check - name: Lint run: cargo clippy --workspace --all-targets -- -D warnings - name: Test run: cargo test --workspace # A short run of each fuzz target: enough to notice a parser change that # breaks on input the seeds are close to. Long runs are done by hand; see # fuzz/README.md. fuzz: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly - name: Install cargo-fuzz run: cargo install cargo-fuzz --locked - name: Fuzz working-directory: fuzz # cargo-fuzz sets its own flags; the workspace's -D warnings would # replace them. env: RUSTFLAGS: "" run: | for target in message message_body prefix_text config; do mkdir -p "corpus/$target" cargo fuzz run "$target" "corpus/$target" "seeds/$target" -- -max_total_time=60 done