|
|
|
@ -7,88 +7,56 @@ env:
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
|
build-windows:
|
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
|
|
- name: Install libusb-1.0
|
|
|
|
|
run: sudo apt-get install libusb-1.0-0-dev
|
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
|
with:
|
|
|
|
|
submodules: 'true'
|
|
|
|
|
- name: install llvm and clang
|
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
|
with:
|
|
|
|
|
version: "10.0"
|
|
|
|
|
directory: ${{ runner.temp }}/llvm
|
|
|
|
|
- name: set LIBCLANG_PATH
|
|
|
|
|
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
|
|
|
|
- name: build
|
|
|
|
|
shell: bash
|
|
|
|
|
run: cargo build --workspace --verbose
|
|
|
|
|
|
|
|
|
|
- name: Build examples
|
|
|
|
|
- name: run tests
|
|
|
|
|
shell: bash
|
|
|
|
|
run: cargo test --workspace --verbose
|
|
|
|
|
- name: build examples
|
|
|
|
|
shell: bash
|
|
|
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
|
|
|
|
|
|
build-arm:
|
|
|
|
|
build-ubuntu:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
|
with:
|
|
|
|
|
toolchain: stable
|
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
|
override: true
|
|
|
|
|
- run: sudo apt-get install libusb-1.0-0-dev
|
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
|
with:
|
|
|
|
|
use-cross: true
|
|
|
|
|
command: build
|
|
|
|
|
args: --target aarch64-unknown-linux-gnu --workspace --verbose
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
|
|
- name: Install libusb-1.0
|
|
|
|
|
submodules: 'true'
|
|
|
|
|
- name: install libusb-1.0
|
|
|
|
|
run: sudo apt-get install libusb-1.0-0-dev
|
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
|
|
- name: Run all tests
|
|
|
|
|
- name: build
|
|
|
|
|
run: cargo build --workspace --verbose
|
|
|
|
|
- name: run tests
|
|
|
|
|
run: cargo test --workspace --verbose
|
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
|
|
|
|
|
|
- name: Run all tests
|
|
|
|
|
run: cargo test --workspace --exclude memflow-derive --verbose
|
|
|
|
|
- name: build examples
|
|
|
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
with:
|
|
|
|
|
submodules: 'true'
|
|
|
|
|
- name: install libusb-1.0
|
|
|
|
|
run: sudo apt-get install libusb-1.0-0-dev
|
|
|
|
|
- run: rustup component add clippy
|
|
|
|
|
- name: Check formatting
|
|
|
|
|
- name: check formatting
|
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
|
with:
|
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
args: --all-targets
|
|
|
|
|
|
|
|
|
|
build-coverage:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
- name: Set up Rust nightly
|
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
|
with:
|
|
|
|
|
profile: minimal
|
|
|
|
|
toolchain: nightly
|
|
|
|
|
override: true
|
|
|
|
|
- run: cargo install grcov
|
|
|
|
|
- name: Run tests with coverage
|
|
|
|
|
run: |
|
|
|
|
|
export CARGO_INCREMENTAL=0
|
|
|
|
|
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
|
|
|
|
export RUSTDOCFLAGS="-Cpanic=abort"
|
|
|
|
|
cargo build --workspace --exclude memflow-derive
|
|
|
|
|
cargo test --workspace --exclude memflow-derive
|
|
|
|
|
grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage
|
|
|
|
|
bash <(curl -s https://codecov.io/bash) -f ./target/debug/coverage -t ${{ secrets.CODECOV_TOKEN }};
|
|
|
|
|