mobux 0.1.5

A touch-friendly tmux web UI for unhinged people who run terminal sessions from their phone while walking the dog
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo check
      - run: cargo test --no-run
      - run: cargo clippy -- -D warnings

  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npx playwright install chromium
      - run: sudo apt-get install -y tmux
      - name: Build mobux
        run: cargo build
      - name: Run critical-path tests
        run: make test-critical-path
        env:
          CI: true
          MOBUX_URL: http://localhost:8281
      - name: Run smoke tests
        run: make test-smoke
        env:
          CI: true
          MOBUX_URL: http://localhost:8281
      - name: Run mesh relay tests (two-instance)
        run: make test-mesh
        env:
          CI: true
          MOBUX_URL: http://localhost:8281

  release-plz-pr:
    needs: [check, e2e]
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main' && github.event_name == 'push'
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    steps:
      # ssh-key checkout: release-plz's branch pushes go over the deploy key,
      # so they trigger CI on the release PR (GITHUB_TOKEN events don't —
      # this replaces the manual empty-commit nudge, see DEPLOY.md).
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ssh-key: ${{ secrets.RELEASE_PLZ_DEPLOY_KEY }}
      - uses: dtolnay/rust-toolchain@stable
      - uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release-pr
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  release-plz-release:
    needs: [check, e2e]
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main' && github.event_name == 'push'
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      - uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  # Auto-merge green release PRs and publish in the same run. The merge is
  # done with GITHUB_TOKEN, whose push to main does NOT retrigger CI
  # (anti-recursion) — which is why the publish step runs here instead of
  # relying on the main-push release-plz-release job.
  release-auto-merge:
    needs: [check, e2e]
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'release-plz-')
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    permissions:
      contents: write
      pull-requests: write
    steps:
      - name: Merge release PR
        run: gh pr merge "$PR" --squash --repo "$GH_REPO"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GH_REPO: ${{ github.repository }}
          PR: ${{ github.event.pull_request.number }}
      - uses: actions/checkout@v4
        with:
          ref: main
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      - uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}