mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-10 14:06:48 -06:00
126 lines
2.9 KiB
YAML
126 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [master]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
# Frontend checks
|
|
frontend-check:
|
|
name: Frontend Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "pnpm"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Check TypeScript
|
|
run: pnpm run build
|
|
|
|
- name: Format check
|
|
run: pnpm exec prettier --check .
|
|
continue-on-error: true
|
|
|
|
# Rust backend checks
|
|
rust-check:
|
|
name: Rust Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Install Linux dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Format check
|
|
run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings
|
|
|
|
- name: Run tests
|
|
run: cargo test --manifest-path src-tauri/Cargo.toml --all-features
|
|
|
|
# Security audit
|
|
security-audit:
|
|
name: Security Audit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install cargo-audit
|
|
uses: taiki-e/cache-cargo-install-action@v2
|
|
with:
|
|
tool: cargo-audit
|
|
|
|
- name: Run security audit
|
|
run: cargo audit --file src-tauri/Cargo.lock
|
|
|
|
# Check if Tauri app builds successfully
|
|
build-check:
|
|
name: Build Check
|
|
runs-on: ubuntu-latest
|
|
needs: [frontend-check, rust-check]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "pnpm"
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Install Linux dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Install frontend dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build Tauri app
|
|
run: pnpm tauri build --no-bundle
|