Merge pull request #396 from kevin9327/ci/run-make-check-on-pull-requests

This commit is contained in:
leokun
2026-09-04 16:12:52 +08:00
+45
View File
@@ -0,0 +1,45 @@
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# The workspace includes apps/desktop/src-tauri, so even `cargo check`
# needs the same system libraries the release workflow installs.
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: cargo fmt --all -- --check
run: cargo fmt --all -- --check
- name: cargo clippy --workspace --all-targets -- -D warnings
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test --workspace --all-targets
run: cargo test --workspace --all-targets