Skip to content

Commit 93e42f1

Browse files
committed
consolidate actions
1 parent 6391275 commit 93e42f1

File tree

2 files changed

+53
-66
lines changed

2 files changed

+53
-66
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ on:
99
jobs:
1010
ci:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
permissions:
14+
contents: read
15+
pull-requests: write
1216
strategy:
1317
matrix:
14-
task: [lint, test]
18+
task: [lint, test, e2e]
1519
steps:
1620
- name: Checkout
1721
uses: actions/checkout@v5
@@ -30,6 +34,10 @@ jobs:
3034
- name: Install dependencies
3135
run: pnpm install
3236

37+
- name: Install Playwright Browsers
38+
if: matrix.task == 'e2e'
39+
run: pnpm playwright install --with-deps
40+
3341
- name: Run lint
3442
if: matrix.task == 'lint'
3543
run: pnpm lint:ci
@@ -38,9 +46,53 @@ jobs:
3846
if: matrix.task == 'test'
3947
run: pnpm test:ci
4048

49+
- name: Run e2e tests
50+
if: matrix.task == 'e2e'
51+
env:
52+
AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }}
53+
run: pnpm test:e2e:headless
54+
4155
- name: Upload coverage artifact
4256
if: matrix.task == 'test' && github.event_name == 'pull_request'
4357
uses: actions/upload-artifact@v4
4458
with:
4559
name: vitest-coverage
4660
path: vitest-coverage
61+
62+
- name: Upload Playwright report
63+
if: matrix.task == 'e2e' && failure()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: playwright-report
67+
path: playwright-report/
68+
retention-days: 30
69+
70+
- name: Comment PR with Playwright artifact link
71+
if: matrix.task == 'e2e' && failure() && github.event_name == 'pull_request'
72+
uses: actions/github-script@v7
73+
with:
74+
script: |
75+
const runId = context.runId;
76+
const repo = context.repo;
77+
const artifactUrl = `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`;
78+
79+
const comment = `## ❌ Playwright Tests Failed
80+
81+
The Playwright tests have failed. Please download the test report artifact to see detailed information about the failures:
82+
83+
📊 [View test run and download artifact](${artifactUrl})
84+
85+
**How to view the report:**
86+
1. Click the link above
87+
2. Scroll to the bottom to the "Artifacts" section
88+
3. Download the \`playwright-report\` artifact
89+
4. Extract the zip file and open \`index.html\` in your browser
90+
91+
The report includes screenshots, videos, and detailed traces of the failed tests.`;
92+
93+
github.rest.issues.createComment({
94+
issue_number: context.issue.number,
95+
owner: repo.owner,
96+
repo: repo.repo,
97+
body: comment
98+
});

.github/workflows/e2e.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)