Add Vitest PR check and fix ptyIpc remote-init tests #1237
Workflow file for this run
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: Code Consistency Check | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| format-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| ELECTRON_SKIP_BINARY_DOWNLOAD: '1' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.28.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.20.0' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| # This job only needs JS/TS tooling for format + type checks. | |
| # Skip lifecycle scripts to avoid flaky node-gyp/native module builds in CI. | |
| run: | | |
| for attempt in 1 2 3; do | |
| pnpm install --frozen-lockfile --ignore-scripts && break | |
| if [ "$attempt" -eq 3 ]; then | |
| echo "pnpm install failed after 3 attempts" | |
| exit 1 | |
| fi | |
| echo "Install failed (attempt $attempt). Retrying in 10s..." | |
| sleep 10 | |
| done | |
| - name: Check formatting | |
| run: pnpm run format:check | |
| # TODO: add this once fixed across all files | |
| # - name: Check linting | |
| # run: pnpm run lint | |
| - name: Type check | |
| run: pnpm run type-check | |
| vitest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.28.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.20.0' | |
| cache: 'pnpm' | |
| - name: Install Linux native deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libsecret-1-0 libsecret-1-dev | |
| - name: Install dependencies | |
| # Tests import Electron/keytar paths, so lifecycle scripts must run. | |
| run: | | |
| for attempt in 1 2 3; do | |
| pnpm install --frozen-lockfile && break | |
| if [ "$attempt" -eq 3 ]; then | |
| echo "pnpm install failed after 3 attempts" | |
| exit 1 | |
| fi | |
| echo "Install failed (attempt $attempt). Retrying in 10s..." | |
| sleep 10 | |
| done | |
| - name: Run Vitest | |
| run: pnpm exec vitest run |