Adds .forgejo/workflows/check.yml (and a GitHub mirror) that runs on every branch push (except main) and on every PR targeting main. Two parallel jobs: - rust: cargo check + cargo test, with cargo registry/git/target caches keyed on Cargo.lock. Installs the minimal Rust toolchain and the webkit2gtk system deps that the tauri build script needs. - frontend: npm ci + npm run build (tsc + vite) + npm test (vitest), with the npm cache keyed on package-lock.json. The Forgejo workflow uses the ubuntu:22.04 container pattern from release.yml. The GitHub mirror uses native runners (ubuntu-latest) since the GitHub mirror exists for portability and uses GitHub-native actions. Documents the new workflow in CLAUDE.md alongside release.yml so future contributors know what CI runs before merge.
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
name: PR Check
|
|
|
|
# Mirror of .forgejo/workflows/check.yml using GitHub-native runners.
|
|
# Forgejo is the primary host; this file keeps the GitHub mirror functional.
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
rust:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
pkg-config libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libssl-dev
|
|
|
|
- name: Install Rust toolchain (stable)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo
|
|
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 check
|
|
run: cargo check --manifest-path src-tauri/Cargo.toml --all-targets
|
|
|
|
- name: cargo test
|
|
run: cargo test --manifest-path src-tauri/Cargo.toml --all-targets
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build (tsc + vite)
|
|
run: npm run build
|
|
|
|
- name: Tests (vitest)
|
|
run: npm test
|