-
Notifications
You must be signed in to change notification settings - Fork 65
61 lines (61 loc) · 1.96 KB
/
playwright.yml
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
57
58
59
60
61
name: Playwright Tests
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Set the version suffix for the output
run: echo VERSION_SUFFIX=${GITHUB_REF_NAME//\//-} >> $GITHUB_ENV
- name: Build Stackable Free Plugin
run: |
npm ci --legacy-peer-deps
npm run build:no-translate
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Install wp-env
run: |
npm install -g @wordpress/env
- name: Start wp-env
run: wp-env start
- name: Run playwright tests
env:
WP_BASE_URL: http://localhost:8888
WP_AUTH_STORAGE: wp-auth.json
WP_USERNAME: admin
WP_PASSWORD: password
STACKABLE_SLUG: Stackable/plugin
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ env.VERSION_SUFFIX }}.zip
path: playwright-report/
retention-days: 30
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Playwright Report Artifact
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
` ## Playwright Report Artifact
| file | commit |
| ---- | ------ |
| [playwright-report-${{ env.VERSION_SUFFIX }}.zip](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) | ${{ github.sha }} |
`
edit-mode: replace