Add Rust bindings #1
Workflow file for this run
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
name: Rust bindings | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
build: | |
name: Test - ${{ matrix.os.name }} ${{ matrix.arch.name }} | |
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- name: macOS | |
matrix: macos | |
runs-on: | |
arm: [macOS, ARM64] | |
intel: [macos-latest] | |
- name: Ubuntu | |
matrix: ubuntu | |
runs-on: | |
arm: [Linux, ARM64] | |
intel: [ubuntu-latest] | |
- name: Windows | |
matrix: windows | |
runs-on: | |
intel: [windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Build | |
run: cargo build --release | |
- name: Test | |
run: cargo test | |
- name: Test (Release) | |
run: cargo test --release | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- name: Check clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
- name: Create release | |
continue-on-error: true | |
if: startsWith(github.event.ref, 'refs/tags') | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish | |
fuzz_targets: | |
name: Run Fuzzer | |
runs-on: ubuntu-latest | |
env: | |
CARGO_PROFILE_RELEASE_LTO: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: cargo-fuzz | |
run: cargo +nightly install cargo-fuzz | |
- name: cargo fuzz | |
run: | | |
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=120 || exit 255" |