on:
  push:
    paths:
      - src-tauri/**
      - .github/workflows/**

name: CI (Rust)

defaults:
  run:
    working-directory: src-tauri

jobs:
  test:
    name: Check/Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          sparse-checkout: 'src-tauri'
          sparse-checkout-cone-mode: false
      - run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.1-dev
      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly # required for `cargo udeps`
          override: true
      - name: Lint
        run: cargo check
      - name: Test
        run: cargo test --all
