Skip to content

fix example builds

fix example builds #50

Workflow file for this run

name: Build and Test
on:
push:
pull_request:
branches: [main]
types: [opened, reopened]
workflow_dispatch:
concurrency:
group: rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
build:
runs-on: ubuntu-latest
strategy:
matrix:
feature-args:
- --all-features
- --no-default-features --features alloc
- --no-default-features
steps:
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build
run: cargo build ${{ matrix.feature-args }} --verbose
- name: Test
run: cargo test ${{ matrix.feature-args }} -- --nocapture
build_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install libudev
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build
run: cd ${{ github.workspace }}/examples && cargo build --release
- name: Coding style
run: |
cd ${{ github.workspace }}/examples && cargo fmt --all -- --check
cd ${{ github.workspace }}/examples && cargo clippy --all-features --all-targets -- -D warnings