name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false fetch-depth: 0 - name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy, miri
- name: Lint (fmt)
run: cargo fmt --check
- name: Lint (clippy)
run: cargo clippy -- -D warnings
- name: Install cargo-msrv
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-msrv
locked: false
- name: Verify MSRV
run: cargo msrv verify --ignore-lockfile
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Check (feature power-set)
run: >
cargo hack check --feature-powerset
--group-features bool_type,if_expression
--group-features arbitrary,serde,bitcode
- name: Test (feature power-set)
run: >
cargo hack test --feature-powerset
--group-features bool_type,if_expression,while_loop
--group-features f32_type,string_type,extern_value_type
--group-features single_line_comment,multi_line_comment
--group-features arbitrary,serde,bitcode
- name: Setup Miri
run: cargo miri setup
- name: Test (miri all-features)
run: cargo miri test --all-features
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install cargo-fuzz
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-fuzz
locked: false
- name: Fuzz (code generator)
run: RUST_BACKTRACE=1 cargo fuzz run code_generator -- -max_total_time=300 -rss_limit_mb=4096 -timeout=5
- name: Fuzz (virtual machine)
run: RUST_BACKTRACE=1 cargo fuzz run virtual_machine -- -max_total_time=300 -rss_limit_mb=4096 -timeout=5
- name: Fuzz (parser)
run: RUST_BACKTRACE=1 cargo fuzz run parser -- -max_total_time=300 -rss_limit_mb=4096 -timeout=5 -seed_inputs="./fuzz/parser_seed.txt"