name: common
on:
merge_group:
types: [checks_requested]
workflow_call:
pull_request:
push:
branches:
- main
env:
RUSTFLAGS: "-Dwarnings"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check
check:
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update -y
sudo apt-get install -y dbus libdbus-1-dev
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo check --tests --workspace
- run: cargo clippy --all-targets --all-features --tests
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test