mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-09-04 23:17:45 +08:00
ci: 自动检查pr的后端代码
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
name: Check Backend
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-backend:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
steps:
|
||||
- name: Check backend changes
|
||||
id: changes
|
||||
uses: dorny/paths-filter@v3
|
||||
with:
|
||||
filters: |
|
||||
backend:
|
||||
- 'src-tauri/**'
|
||||
- '.github/workflows/check-backend.yml'
|
||||
|
||||
- name: Skip backend checks when unchanged
|
||||
if: steps.changes.outputs.backend != 'true'
|
||||
run: echo "No backend changes detected, skipping backend checks."
|
||||
|
||||
- name: Checkout code
|
||||
if: steps.changes.outputs.backend == 'true'
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
if: steps.changes.outputs.backend == 'true'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Rust cache
|
||||
if: steps.changes.outputs.backend == 'true'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: src-tauri -> target
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.changes.outputs.backend == 'true'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- name: Run Clippy
|
||||
if: steps.changes.outputs.backend == 'true'
|
||||
working-directory: src-tauri
|
||||
run: cargo clippy -- -D warnings
|
||||
Reference in New Issue
Block a user