Files
noteflow/.gitea/workflows/quality.yml

142 lines
3.3 KiB
YAML

name: Quality
on:
pull_request:
branches: [main, develop]
env:
PYTHON_VERSION: "3.12"
NODE_VERSION: "22"
RUST_TOOLCHAIN: "stable"
jobs:
quality-python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Create hygiene directory
run: mkdir -p .hygeine
- name: Run Basedpyright type checking
run: basedpyright
- name: Run Ruff linting
run: ruff check .
- name: Run Python quality tests
run: pytest tests/quality/ -q
quality-typescript:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: client
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
run: npm ci
- name: Create hygiene directory
run: mkdir -p ../.hygeine
- name: Run TypeScript type checking
run: npm run type-check
- name: Run Biome linting
run: npx biome lint . --reporter=github
- name: Run TypeScript quality tests
run: npm run test:quality
quality-rust:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: client/src-tauri
steps:
- uses: actions/checkout@v4
- name: Install system dependencies (Tauri)
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libasound2-dev
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
client/src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('client/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Check formatting
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy -- -D warnings
format-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install client dependencies
run: cd client && npm ci
- name: Check Biome formatting
run: cd client && npm run format:check
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt
- name: Check Rust formatting
run: cd client/src-tauri && cargo fmt --check