-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (105 loc) · 3.23 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: End-to-end tests and smoke tests
on:
push:
workflow_dispatch:
jobs:
report-pending:
runs-on: ubuntu-latest
steps:
- name: Report pending status
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: 'test'
description: 'Running'
state: 'pending'
playwright:
needs: report-pending
strategy:
matrix:
suite: ["desktop", "mobile", "iphone", "webkit", "brand"]
timeout-minutes: 120
services:
# Label used to access the service container
mongo:
# Docker Hub image
image: mongo
ports:
- 27017:27017
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "node_version=$(cat .github/nodejs.version)" >> $GITHUB_ENV
- name: "use node ${{ env.node_version }}"
uses: actions/setup-node@v3
with:
node-version: "${{ env.node_version }}"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build app
run: yarn build
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run Playwright tests
run: yarn e2e:${{ matrix.suite }}
env:
MONGO_URI: mongodb://127.0.0.1:27017
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report[${{ matrix.suite }}]
path: playwright-report/
retention-days: 90
storybook:
needs: report-pending
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "node_version=$(cat .github/nodejs.version)" >> $GITHUB_ENV
- name: "use node ${{ env.node_version }}"
uses: actions/setup-node@v3
with:
node-version: "${{ env.node_version }}"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build app
run: yarn build
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Smoke & Acceptance tests
run: |
yarn build-storybook --quiet
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:127.0.0.1:6006 && yarn test-storybook"
- uses: actions/upload-artifact@v4
if: always()
with:
name: storybook-static
path: storybook-static/
retention-days: 90
report-fail:
needs: [playwright, storybook]
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
- name: Report failure status
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: 'test'
description: 'Failed'
state: 'failure'
report-success:
needs: [playwright, storybook]
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- name: Report success status # You would run your tests before this using the output to set state/desc
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: 'test'
description: 'Passed'
state: 'success'