You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
name: Build and test
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: build
|
|
run: cargo build --workspace --verbose
|
|
- name: run tests
|
|
run: cargo test --workspace --verbose
|
|
- name: build examples
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
build-ubuntu:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: install libusb-1.0
|
|
run: sudo apt-get install libusb-1.0-0-dev
|
|
- name: build
|
|
run: cargo build --workspace --verbose
|
|
- name: run tests
|
|
run: cargo test --workspace --verbose
|
|
- name: build examples
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: keepitsimpletech/actions/setup-macports@setup-macports/releases/v1
|
|
- name: install libusb-1.0
|
|
run: sudo port -vs install libusb libusb-devel
|
|
- name: build
|
|
run: cargo build --workspace --verbose
|
|
- name: run tests
|
|
run: cargo test --workspace --verbose
|
|
- name: build examples
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
build-ubuntu-aarch64:
|
|
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
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: rustup component add clippy
|
|
- 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: setup 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 }};
|