Rust Check #113
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
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 |