From d7b82fad91200ced66b693740e05e893f51713d2 Mon Sep 17 00:00:00 2001 From: Hojjat Date: Tue, 22 Sep 2026 17:32:57 -0600 Subject: [PATCH] chore: set up github actions for fmt, test, and clippy --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ rust-toolchain.toml | 3 +++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4314fab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: Continuous integration + +on: + push: + branches: [master] + pull_request: + +env: + CARGO_TERM_COLOR: always + DEBIAN_FRONTEND: noninteractive + +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - name: install toolchain + run: rustup toolchain install nightly --component rustfmt + - name: fmt + run: cargo +nightly fmt --all --check + + clippy: + name: Clippy + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - name: install system dependencies + run: sudo apt-get update && sudo apt-get install -y pkg-config libglib2.0-dev libxkbcommon-dev libwayland-dev + - name: install toolchain + run: rustup show + - uses: Swatinem/rust-cache@v2 + - name: clippy + run: cargo clippy --all-features --all-targets -- -D warnings + + test: + name: Test + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - name: install system dependencies + run: sudo apt-get update && sudo apt-get install -y pkg-config libglib2.0-dev libxkbcommon-dev libwayland-dev + - name: install toolchain + run: rustup show + - uses: Swatinem/rust-cache@v2 + - name: test + run: cargo test --all-features diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..bbfabdb --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.93" +components = ["clippy", "rustfmt"]