name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest"]
rust_channel: ["stable", "beta", "nightly", "1.42.0"]
include:
- rust_channel: "stable"
os: "macOS-latest"
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install rust channel
run: |
rustup install ${{matrix.rust_channel}}
rustup default ${{matrix.rust_channel}}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run dwarfdump (macos)
if: matrix.os == 'macOS-latest'
run: |
cargo run --example dwarfdump -- \
$(find ./target/debug -type f | grep DWARF | grep gimli | head -n 1) \
> /dev/null
- name: Run dwarfdump (linux)
if: matrix.os == 'ubuntu-latest'
run: |
cargo run --example dwarfdump -- \
$(find ./target/debug -type f -perm -100 | grep gimli | head -n 1) \
> /dev/null
build_fuzz_targets:
name: Build fuzz targets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install nightly rust
run: |
rustup install nightly
rustup default nightly
- name: Install `cargo fuzz`
run: cargo install cargo-fuzz --vers "^0.7.4"
- run: cargo fuzz build -Oa
- uses: actions/upload-artifact@v2
with:
name: fuzz-targets
path: fuzz/target/x86_64-unknown-linux-gnu/release/debug_*
- uses: actions/upload-artifact@v2
with:
name: fuzz-targets
path: fuzz/target/x86_64-unknown-linux-gnu/release/eh_*
features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features read
- run: cargo test --no-default-features --features read,fallible-iterator
- run: cargo test --no-default-features --features read,std
- run: cargo test --no-default-features --features read,endian-reader
- run: cargo test --no-default-features --features read,endian-reader,std
- run: cargo test --no-default-features --features write
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install nightly rust
run: |
rustup install nightly
rustup default nightly
- run: cargo bench
cross:
strategy:
matrix:
target:
- "i686-unknown-linux-gnu"
- "mips64-unknown-linux-gnuabi64"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- run: cargo install cross
- run: rustup target add ${{matrix.target}}
- run: cross test --target ${{matrix.target}}
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install rust
run: |
rustup install stable
rustup default stable
rustup component add rustfmt
- run: cargo fmt --all -- --check
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
- name: Install nightly rust
run: |
rustup install nightly
rustup default nightly
- name: Install cargo tarpaulin
run: RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --force cargo-tarpaulin
- name: Run cargo tarpaulin
run: cargo tarpaulin --verbose
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo doc