diff --git a/.github/workflows/check-backend.yml b/.github/workflows/check-backend.yml new file mode 100644 index 0000000..94eb6cc --- /dev/null +++ b/.github/workflows/check-backend.yml @@ -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