mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
name: Rust quality checks
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'src-tauri/**'
|
|
- '.github/workflows/rust-quality.yml'
|
|
push:
|
|
branches: [dev]
|
|
paths:
|
|
- 'src-tauri/**'
|
|
- '.github/workflows/rust-quality.yml'
|
|
merge_group:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
format:
|
|
name: Rust format
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # 2c7215f132e9ebf062739d9130488b56d53c060c
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt
|
|
|
|
- name: Check Rust formatting
|
|
run: cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
|
|
|
|
checks:
|
|
name: Rust check, test, and Clippy
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Tauri build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
libayatana-appindicator3-dev \
|
|
libgtk-3-dev \
|
|
librsvg2-dev \
|
|
libsoup-3.0-dev \
|
|
libssl-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libxdo-dev \
|
|
pkg-config
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # 2c7215f132e9ebf062739d9130488b56d53c060c
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
|
|
- name: Cache Rust build
|
|
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Check native app
|
|
run: cargo check --locked --manifest-path src-tauri/Cargo.toml
|
|
|
|
- name: Run Rust tests
|
|
run: cargo test --locked --manifest-path src-tauri/Cargo.toml
|
|
|
|
- name: Run Clippy
|
|
run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
|