fix(ci): correct working-directory — package-lock.json is at repo root, not e2e/
This commit is contained in:
27
.github/workflows/smoke.yml
vendored
27
.github/workflows/smoke.yml
vendored
@@ -6,9 +6,9 @@
|
|||||||
# - Manually via workflow_dispatch (run before any prod deploy)
|
# - Manually via workflow_dispatch (run before any prod deploy)
|
||||||
# - Called by other repos via workflow_call (deploy gates)
|
# - Called by other repos via workflow_call (deploy gates)
|
||||||
#
|
#
|
||||||
# Secrets required (set in GitHub repo Settings → Secrets → Actions):
|
# Secrets required (set in GitHub repo Settings -> Secrets -> Actions):
|
||||||
# STAGING_WP_ADMIN_USER — WordPress admin username on staging
|
# STAGING_WP_ADMIN_USER -- WordPress admin username on staging
|
||||||
# STAGING_WP_ADMIN_PASSWORD — WordPress admin password on staging
|
# STAGING_WP_ADMIN_PASSWORD -- WordPress admin password on staging
|
||||||
|
|
||||||
name: Smoke Tests (Staging)
|
name: Smoke Tests (Staging)
|
||||||
|
|
||||||
@@ -16,9 +16,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
base_url:
|
base_url:
|
||||||
description: 'Target URL (defaults to staging)'
|
description: "Target URL (defaults to staging)"
|
||||||
required: false
|
required: false
|
||||||
default: 'https://staging.peptiderepo.com'
|
default: "https://staging.peptiderepo.com"
|
||||||
|
|
||||||
# Allow other repos to call this workflow as a deploy gate
|
# Allow other repos to call this workflow as a deploy gate
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@@ -26,7 +26,7 @@ on:
|
|||||||
base_url:
|
base_url:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: 'https://staging.peptiderepo.com'
|
default: "https://staging.peptiderepo.com"
|
||||||
secrets:
|
secrets:
|
||||||
STAGING_WP_ADMIN_USER:
|
STAGING_WP_ADMIN_USER:
|
||||||
required: true
|
required: true
|
||||||
@@ -46,22 +46,19 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: "22"
|
||||||
cache: 'npm'
|
cache: "npm"
|
||||||
cache-dependency-path: e2e/package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: e2e
|
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
working-directory: e2e
|
|
||||||
run: npx playwright install chromium --with-deps
|
run: npx playwright install chromium --with-deps
|
||||||
|
|
||||||
- name: Run smoke tests
|
- name: Run smoke tests
|
||||||
working-directory: e2e
|
|
||||||
env:
|
env:
|
||||||
BASE_URL: ${{ inputs.base_url || 'https://staging.peptiderepo.com' }}
|
BASE_URL: ${{ inputs.base_url || "https://staging.peptiderepo.com" }}
|
||||||
WP_ADMIN_USER: ${{ secrets.STAGING_WP_ADMIN_USER }}
|
WP_ADMIN_USER: ${{ secrets.STAGING_WP_ADMIN_USER }}
|
||||||
WP_ADMIN_PASSWORD: ${{ secrets.STAGING_WP_ADMIN_PASSWORD }}
|
WP_ADMIN_PASSWORD: ${{ secrets.STAGING_WP_ADMIN_PASSWORD }}
|
||||||
run: npx playwright test
|
run: npx playwright test
|
||||||
@@ -71,7 +68,7 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: playwright-report
|
||||||
path: e2e/playwright-report/
|
path: playwright-report/
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|
||||||
- name: Upload failure screenshots/videos
|
- name: Upload failure screenshots/videos
|
||||||
@@ -79,5 +76,5 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: playwright-failures
|
name: playwright-failures
|
||||||
path: e2e/test-results/
|
path: test-results/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|||||||
Reference in New Issue
Block a user