Files
claude-code-viewer/.github/workflows/ci.yml
2025-10-13 14:39:12 +09:00

85 lines
1.9 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Quality Checks
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.8.1
- name: Setup Node.js 20.12.0
uses: actions/setup-node@v4
with:
node-version: 20.12.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run linting
run: pnpm lint
- name: Run type checking
run: pnpm typecheck
e2e:
name: E2E Visual Regression Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.8.1
- name: Setup Node.js 20.12.0
uses: actions/setup-node@v4
with:
node-version: 20.12.0
cache: 'pnpm'
- name: Setup Git user
shell: bash
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project
run: pnpm build
- name: Capture screenshots
run: pnpx tsx ./e2e/captureSnapshot/index.ts
env:
MAX_CONCURRENCY: 5
- name: Commit screenshots
run: |
git add e2e/snapshots
git diff --staged --exit-code || (git commit -m 'ci(snapshots): update screenshots' && git push)