Skip to content

ci: add GitHub Actions for Rust checks #2

ci: add GitHub Actions for Rust checks

ci: add GitHub Actions for Rust checks #2

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: cargo check + clippy + fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libgtk-3-dev
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: cargo fmt
working-directory: src-tauri
run: cargo fmt --check
- name: cargo check
working-directory: src-tauri
run: cargo check
- name: cargo clippy
working-directory: src-tauri
run: cargo clippy -- -D warnings