Add a Mock backend and Port::open_mock() methods to use it #348
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --all-features | |
check-unstable: | |
name: Check (Unstable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: RUSTFLAGS="--cfg unstable" cargo check --all-features | |
test: | |
name: Test Suite | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macOS-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test --features=ascii,binary --workspace --verbose | |
test-unstable: | |
name: Test Suite (Unstable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- run: RUSTFLAGS="--cfg unstable" cargo +nightly test --all-features --workspace --verbose | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all-features | |
clippy-unstable: | |
name: Clippy (Unstable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: RUSTFLAGS="--cfg unstable" cargo clippy --all-features | |
spelling: | |
name: Spell Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm install @cspell/dict-rust | |
- uses: streetsidesoftware/cspell-action@v6 | |
with: | |
incremental_files_only: false | |
doc: | |
name: Rustdoc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rust-docs | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo doc --no-deps --all-features | |
doc-unstable: | |
name: Rustdoc (Unstable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libudev | |
run: | | |
sudo apt update | |
sudo apt install libudev-dev | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rust-docs | |
- uses: Swatinem/rust-cache@v2 | |
- run: RUSTDOCFLAGS="--cfg unstable" cargo doc --no-deps --all-features |