Skip to content

Add AI-powered PR review system for Playwright + TypeScript #21

Add AI-powered PR review system for Playwright + TypeScript

Add AI-powered PR review system for Playwright + TypeScript #21

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
inputs:
environment:
description: Test environment
required: true
default: dev
type: choice
options: [dev, qa, staging, prod]
env:
CI: true
ENV: ${{ github.event.inputs.environment || 'dev' }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
snyk:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Run Snyk scan
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
if [ -z "$SNYK_TOKEN" ]; then
echo "SNYK_TOKEN not set — skipping Snyk scan"
exit 0
fi
npx snyk test
test:
needs: [lint, snyk]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ matrix.browser }}-${{ hashFiles('package-lock.json') }}-v2
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install ${{ matrix.browser == 'chromium' && 'chromium chromium-headless-shell' || matrix.browser }}
- name: Install system dependencies
run: npx playwright install-deps ${{ matrix.browser }}
- name: Run tests
run: npx playwright test --project=${{ matrix.browser }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: reports-${{ matrix.browser }}
path: |
playwright-report/
test-results/
allure-results/
screenshots/
logs/