|
|
|
name: Build and test
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build_ubuntu_x86-64_bundled:
|
|
|
|
name: Build for ubuntu-latest (x86-64) with bundled headers
|
|
|
|
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
|
|
|
|
- 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_x86-64_bindgen:
|
|
|
|
name: Build for ubuntu-latest (x86-64) with generated headers
|
|
|
|
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
|
|
|
|
- name: build
|
|
|
|
run: cargo build --workspace --features bindgen --verbose
|
|
|
|
- name: run tests
|
|
|
|
run: cargo test --workspace --features bindgen --verbose
|
|
|
|
- name: build examples
|
|
|
|
run: cargo build --workspace --features bindgen --examples --verbose
|
|
|
|
|
|
|
|
build_windows_x86-64_bundled:
|
|
|
|
name: Build for windows-latest (x86-64) with bundled headers
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'true'
|
|
|
|
- name: build
|
|
|
|
shell: bash
|
|
|
|
run: cargo build --workspace --verbose
|
|
|
|
- name: run tests
|
|
|
|
shell: bash
|
|
|
|
run: cargo test --workspace --verbose
|
|
|
|
- name: build examples
|
|
|
|
shell: bash
|
|
|
|
run: cargo build --workspace --examples --verbose
|
|
|
|
|
|
|
|
build_windows_x86-64_bindgen:
|
|
|
|
name: Build for windows-latest (x86-64) with generated headers
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
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 --features bindgen --verbose
|
|
|
|
- name: run tests
|
|
|
|
shell: bash
|
|
|
|
run: cargo test --workspace --features bindgen --verbose
|
|
|
|
- name: build examples
|
|
|
|
shell: bash
|
|
|
|
run: cargo build --workspace --features bindgen --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
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --all-targets
|