Files
playwright-mcp/.github/workflows/ci.yml
2026-02-03 15:21:11 -08:00

91 lines
2.4 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- name: Ensure no changes
run: git diff --exit-code
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Playwright install
run: npx playwright install --with-deps
- name: Build
run: npm run build
- name: Run playwright-mcp tests
id: test-mcp
run: npm run test --workspace=packages/playwright-mcp
continue-on-error: true
- name: Run playwright-cli tests
id: test-cli
run: npm run test --workspace=packages/playwright-cli
continue-on-error: true
- name: Run extension tests
id: test-extension
if: matrix.os == 'macos-15'
run: npm run test --workspace=packages/extension
continue-on-error: true
- name: Check test results
if: steps.test-mcp.outcome == 'failure' || steps.test-cli.outcome == 'failure' || steps.test-extension.outcome == 'failure'
run: exit 1
test_mcp_docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Playwright install
run: npx playwright install --with-deps chromium
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: playwright-mcp-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Run tests
shell: bash
run: |
# Used for the Docker tests to share the test-results folder with the container.
umask 0000
npm run test -- --project=chromium-docker
working-directory: ./packages/playwright-mcp
env:
MCP_IN_DOCKER: 1