-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.79 KB
/
playwright-tests.yml
File metadata and controls
56 lines (56 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 🎭 Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
pages: write
id-token: write
jobs:
test-and-deploy:
timeout-minutes: 60
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 📦 Checkout code
uses: actions/checkout@v4
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: 📥 Install dependencies
run: npm install
- name: 🎭 Install Playwright browsers
run: npx playwright install --with-deps
- name: 🧪 Run Playwright tests
run: npx playwright test --workers=3
env:
CI: true
continue-on-error: true
- name: 📦 Prepare Pages folder
run: |
mkdir -p _site
cp -r playwright-report/* _site/
cp testing.html _site/
echo "✅ File copied to _site"
ls -la _site
- name: 🏗️ Setup GitHub Pages
uses: actions/configure-pages@v4
- name: 📤 Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
- name: 🚀 Deploy to GitHub Pages
id: deployment
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/deploy-pages@v4
- name: 📝 Post report URL to summary
run: |
echo "## ✅ Playwright Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "👉 [View latest report]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pages)" >> $GITHUB_STEP_SUMMARY
echo "👉 [View latest report]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pages)" >> $GITHUB_STEP_SUMMARY