Skip to content

Commit dbf7ce9

Browse files
fix: update GitHub Actions workflow to simplify dependency installation and improve Playwright test execution
1 parent 36291d7 commit dbf7ce9

File tree

1 file changed

+9
-42
lines changed

1 file changed

+9
-42
lines changed

.github/workflows/panda-webhook.yml

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,16 @@ name: Playwright Tests
33
on:
44
deployment_status:
55

6-
defaults:
7-
run:
8-
working-directory: ./
9-
10-
permissions:
11-
contents: read
12-
issues: write # ✅ Required for issue comments
13-
146
jobs:
157
run-e2es:
168
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.ref != 'refs/heads/main'
179
runs-on: ubuntu-latest
18-
name: Run E2E tests
1910
steps:
2011
- name: Checkout repository
2112
uses: actions/checkout@v4
2213

23-
- name: Install Node.js
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: 20
27-
28-
- name: Install pnpm
29-
uses: pnpm/action-setup@v4
30-
with:
31-
version: latest
32-
run_install: false
33-
34-
- name: Get pnpm store directory
35-
shell: bash
36-
run: |
37-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38-
39-
- name: Setup pnpm cache
40-
uses: actions/cache@v4
41-
with:
42-
path: ${{ env.STORE_PATH }}
43-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44-
restore-keys: |
45-
${{ runner.os }}-pnpm-store-
46-
4714
- name: Install dependencies
48-
run: pnpm install --frozen-lockfile && pnpm exec playwright install --with-deps # ✅ Fix Playwright issue
15+
run: npm ci && npx playwright install --with-deps
4916

5017
- name: Create PandaDoc Webhook
5118
id: pandadoc-webhook
@@ -71,27 +38,27 @@ jobs:
7138
SHARED_KEY=$(echo "$RESPONSE" | jq -r '.shared_key')
7239
echo "PANDADOC_WEBHOOK_SHARED_KEY=$SHARED_KEY" >> $GITHUB_ENV
7340
74-
- name: Run E2E tests
41+
- name: Run Playwright tests
7542
env:
76-
NEXT_PUBLIC_URL: ${{ github.event.deployment_status.environment_url }}
77-
run: pnpm test:e2e
43+
BASE_URL: ${{ github.event.deployment_status.environment_url }}
44+
run: npx playwright test
7845

7946
- name: Upload Playwright Report
8047
uses: actions/upload-artifact@v4
48+
if: always()
8149
with:
82-
name: reports
83-
path: playwright/reports/
50+
name: playwright-report
51+
path: playwright-report/
8452
retention-days: 7
8553

8654
- name: GitHub Notification
8755
if: failure()
8856
uses: actions/github-script@v6
8957
with:
90-
github-token: ${{ secrets.GITHUB_TOKEN }} # ✅ Fix GitHub API auth
9158
script: |
92-
github.rest.issues.createComment({
59+
github.issues.createComment({
60+
issue_number: 1,
9361
owner: context.repo.owner,
9462
repo: context.repo.repo,
95-
issue_number: 1,
9663
body: "🚨 Playwright tests failed after deployment!"
9764
});

0 commit comments

Comments
 (0)