The VPS runner (peptide-vps) has OS-level Playwright deps pre-installed by root. --with-deps triggers apt-get which requires sudo, blocked by the runner's NoNewPrivileges systemd hardening. Drop the flag; Playwright's binary-only install succeeds as ghrunner with no elevated privileges. SSH-verified: npx playwright install chromium succeeds for ghrunner user; Chromium 149.0.7827.55 downloaded to /home/ghrunner/.cache/ms-playwright. Bump: v1.7.1 → v1.7.2 Agent-Session: smoke-playwright-nodeps-20260617
80 lines
2.2 KiB
YAML
Executable File
80 lines
2.2 KiB
YAML
Executable File
# smoke.yml — Playwright smoke tests against staging.peptiderepo.com
|
|
#
|
|
# Called by other repos via workflow_call as a deploy gate.
|
|
# Secrets required: STAGING_WP_ADMIN_USER, STAGING_WP_ADMIN_PASSWORD
|
|
#
|
|
# IMPORTANT: When called via workflow_call, GitHub Actions checks out the
|
|
# CALLER's repo by default, not peptide-e2e. We explicitly checkout
|
|
# peptide-e2e so npm ci and Playwright have the correct test code + lock file.
|
|
|
|
name: Smoke Tests (Staging)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
base_url:
|
|
description: 'Target URL (defaults to staging)'
|
|
required: false
|
|
default: 'https://staging.peptiderepo.com'
|
|
|
|
workflow_call:
|
|
inputs:
|
|
base_url:
|
|
type: string
|
|
required: false
|
|
default: 'https://staging.peptiderepo.com'
|
|
secrets:
|
|
STAGING_WP_ADMIN_USER:
|
|
required: true
|
|
STAGING_WP_ADMIN_PASSWORD:
|
|
required: true
|
|
|
|
jobs:
|
|
smoke:
|
|
name: Playwright smoke suite
|
|
runs-on: [self-hosted, peptide-vps]
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout peptide-e2e (explicit — workflow_call defaults to caller repo)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: peptide-repo/peptide-e2e
|
|
ref: main
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install chromium
|
|
|
|
- name: Run smoke tests
|
|
env:
|
|
BASE_URL: ${{ inputs.base_url }}
|
|
WP_ADMIN_USER: ${{ secrets.STAGING_WP_ADMIN_USER }}
|
|
WP_ADMIN_PASSWORD: ${{ secrets.STAGING_WP_ADMIN_PASSWORD }}
|
|
run: npx playwright test
|
|
|
|
- name: Upload test report
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 14
|
|
|
|
- name: Upload failure screenshots/videos
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: playwright-failures
|
|
path: test-results/
|
|
retention-days: 7
|