Skip to content

Rust Check

Rust Check #113

Workflow file for this run

on:
push:
paths: "**.rs"
pull_request:
paths: "**.rs"
workflow_dispatch:
name: Rust Check
env:
# This is required to enable the web_sys clipboard API which egui_web uses
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Format Rust code
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Setup device_query dependencies
run: sudo apt-get install libx11-dev
- name: Setup rdev dependencies
run: sudo apt-get --assume-yes install libxtst-dev libevdev-dev
- name: Lint Rust code
run: cargo clippy -- -D warnings
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Setup device_query dependencies
run: sudo apt-get install libx11-dev
- name: Setup rdev dependencies
run: sudo apt-get --assume-yes install libxtst-dev libevdev-dev
- name: Check
run: cargo check
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Setup device_query dependencies
run: sudo apt-get install libx11-dev
- name: Setup rdev dependencies
run: sudo apt-get --assume-yes install libxtst-dev libevdev-dev
- name: Setup eframe dependencies
run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- name: Test
run: cargo test --verbose --lib