Repository navigation
(remote): make a solo tmux attach look and behave like a local termin… #564
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| # Separate job, not an npm pre-hook: `npm run coverage` (below) has no | |
| # `precoverage`, so `pretest` never fired for it and lint silently never | |
| # ran in CI. A dedicated job can't be skipped by a future script rename — | |
| # it shows up as its own entry in the checks list. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [20, 22] | |
| os: [ubuntu-latest, windows-2022] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # diff-cover needs history to compare against the base branch | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests with coverage | |
| run: npm run coverage | |
| # Gate only NEW/changed lines (patch coverage), not the whole codebase: | |
| # main.js (Electron IPC/native) and the DOM glue cannot be unit-tested, so | |
| # a global threshold is meaningless. Runs once (Node 22 on ubuntu-latest) | |
| # on PRs only — os is pinned here too, or the windows-2022 leg would run | |
| # the same gate a second time with a different lcov path style. | |
| - name: Patch coverage gate (changed lines >= 80%) | |
| if: matrix.node-version == 22 && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' | |
| run: | | |
| python -m pip install --quiet diff_cover | |
| git fetch origin "${{ github.base_ref }}" --quiet | |
| diff-cover coverage/lcov.info \ | |
| --compare-branch "origin/${{ github.base_ref }}" \ | |
| --fail-under 80 \ | |
| --exclude 'main.js' 'preload.js' 'mcp-bridge.js' 'claude-auth.js' \ | |
| 'public/codemirror-bundle.js' 'public/codemirror-setup.js' \ | |
| 'public/terminal-manager.js' 'public/app.js' \ | |
| 'workers/**' 'scripts/**' 'test/**' |