tauri-plugin-bare-kit 0.2.3

Effortless JavaScript backends for Tauri apps - Android 🤖 iOS 📱Linux 🐧 Macos 🖥️ Windows 💩
name: Run Tests

on:
  workflow_dispatch:
  push:
    tags:
      - 'v*'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  desktop-tests:
    name: Desktop Tests (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v6

      - name: Enable Windows long paths for Git
        if: matrix.os == 'windows-latest'
        run: git config --global core.longpaths true

      - uses: awalsh128/cache-apt-pkgs-action@latest
        if: matrix.os == 'ubuntu-latest'
        with:
          packages: libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xvfb
          version: '1.0'

      - uses: ZhongRuoyu/setup-llvm@v0
        with:
          llvm-version: 22

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2
        with:
          workspaces: |
            .
            tests/src-tauri

      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
          cache-dependency-path: 'package-lock.json'

      - name: Run unit tests
        if: matrix.os != 'windows-latest'
        run: cargo test --release --features tests

      - name: Install plugin dependencies
        run: npm ci --ignore-scripts

      - name: Install test app dependencies
        working-directory: tests
        run: npm ci --ignore-scripts

      - name: Build test Tauri app
        working-directory: tests
        run: npm run tauri build -- -- --target-dir ../../target

      - name: Run tests (Linux)
        if: matrix.os == 'ubuntu-latest'
        working-directory: tests
        run: xvfb-run -a npm test

      - name: Run tests
        if: matrix.os != 'ubuntu-latest'
        working-directory: tests
        run: npm test

  ios-tests:
    name: iOS Tests
    runs-on: macos-26
    steps:
      - uses: actions/checkout@v6

      - uses: ZhongRuoyu/setup-llvm@v0
        with:
          llvm-version: 22

      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: aarch64-apple-ios

      - uses: Swatinem/rust-cache@v2
        with:
          workspaces: tests/src-tauri

      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
          cache-dependency-path: 'tests/package-lock.json'

      - name: Install plugin dependencies
        run: npm ci --ignore-scripts

      - name: Install test app dependencies
        working-directory: tests
        run: npm ci --ignore-scripts

      - name: Build test Tauri app
        working-directory: tests
        run: npm run tauri ios build -- --ci --target aarch64-sim

      - name: Run tests
        working-directory: tests
        run: npm run test:ios