Skip to content

Rust

Rust #688

Workflow file for this run

name: Rust
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: rust-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: sudo apt-get install llvm
- name: Cargo sort
run: cargo install cargo-sort && cargo sort --check .
- name: Format
run: cargo fmt && git diff --exit-code
- name: Clippy
run: cargo clippy --all-targets -- -D warnings -W clippy::pedantic -A clippy::missing-panics-doc
build:
strategy:
fail-fast: false
matrix:
environment: [ubuntu-latest, macos-latest]
package: [afl, cargo-afl]
toolchain: [stable, nightly]
cc: [cc, clang]
include:
- cc: cc
cxx: c++
- cc: clang
cxx: clang++
runs-on: ${{ matrix.environment }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- if: ${{ matrix.environment == 'ubuntu-latest' }}
run: sudo apt-get install llvm
- uses: actions/checkout@v3
with:
submodules: true
- name: Rustup
run: rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build -vv
- name: Run afl-system-config
run: |
launchctl list 2>/dev/null
launchctl list 2>/dev/null | grep -q '\.ReportCrash$'
cargo run -p ${{ matrix.package }} -- afl system-config
- name: Build examples (with AFL instrumentation)
run: cargo run -p ${{ matrix.package }} -- afl build --examples -vv
- name: Run tests (with AFL instrumentation)
run: cargo run -p ${{ matrix.package }} -- afl test -vv
all-checks:
needs: [lint, build]
runs-on: ubuntu-latest
steps:
- run: true