mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 14:05:41 +00:00
7b06be5ba2
* ci: make hot-path coverage gates required PR checks Remove continue-on-error from frontend and Rust coverage jobs now that the hot-path lists have stabilized; update docs and script headers. * docs: note hard coverage gates in changelog and credits (PR #921) * chore: drop credits entry for CI-only PR #921 Contributor credits are for user-visible work, not infra toggles.
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
name: rust-tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'src-tauri/**'
|
|
- '.github/workflows/rust-tests.yml'
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'src-tauri/**'
|
|
- '.github/workflows/rust-tests.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: cargo test --workspace
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: install Linux build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \
|
|
libasound2-dev cmake
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
- name: cargo test --workspace
|
|
working-directory: src-tauri
|
|
run: cargo test --workspace --all-targets
|
|
|
|
clippy:
|
|
name: cargo clippy --workspace
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: install Linux build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \
|
|
libasound2-dev cmake
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
- name: cargo clippy --workspace
|
|
working-directory: src-tauri
|
|
run: cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
coverage:
|
|
name: cargo llvm-cov (baseline + hot-path file gate)
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: install Linux build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \
|
|
libasound2-dev cmake jq
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: llvm-tools-preview
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
- uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-llvm-cov
|
|
- name: generate workspace coverage (lcov + json)
|
|
working-directory: src-tauri
|
|
run: |
|
|
mkdir -p target/llvm-cov
|
|
cargo llvm-cov --workspace --lcov --output-path lcov.info
|
|
cargo llvm-cov --workspace --json --output-path target/llvm-cov/cov.json
|
|
- name: hot-path file coverage gate
|
|
run: bash scripts/check-hot-path-coverage.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: rust-coverage-lcov
|
|
path: src-tauri/lcov.info
|
|
if-no-files-found: error
|