-
Notifications
You must be signed in to change notification settings - Fork 144
131 lines (112 loc) · 4.39 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Integration tests
env:
CI: true
WALLET_ENVIRONMENT: testing
BITFLOW_API_HOST: ${{ secrets.BITFLOW_API_HOST }}
BITFLOW_API_KEY: ${{ secrets.BITFLOW_API_KEY }}
BITFLOW_STACKS_API_HOST: ${{ secrets.BITFLOW_STACKS_API_HOST }}
BITFLOW_READONLY_CALL_API_HOST: ${{ secrets.BITFLOW_READONLY_CALL_API_HOST }}
on:
push:
branches:
- gh-readonly-queue/dev/**
pull_request:
branches:
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shardTotal: [10]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-cache-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright browsers
run: pnpm playwright install chrome chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install Playwright deps
run: pnpm playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Build extension in test mode
run: pnpm build:test
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
# Playwright can only test extensions in headed mode, see
# https://playwright.dev/docs/chrome-extensions. To run a browser in
# headed mode, a display server is necessary. However, this job runs on
# an Ubuntu worker without a display server.
#
# The `xvfb-run` utility,
# https://manpages.ubuntu.com/manpages/xenial/man1/xvfb-run.1.html,
# provides a virtual X display server to the process it runs, allowing
# processes that require a display server to run in environments where
# one is not available.
- name: Run Playwright tests
run: xvfb-run pnpm playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
TEST_ACCOUNT_SECRET_KEY: ${{ secrets.TEST_ACCOUNT_SECRET_KEY }}
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: all-blob-reports
path: blob-report
retention-days: 1
if-no-files-found: error
merge-reports:
name: Merge reports
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v3
with:
name: all-blob-reports
path: all-blob-reports
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- uses: Wandalen/wretry.action@master
if: github.event_name == 'pull_request'
with:
action: peaceiris/actions-gh-pages@v3
with: |
personal_token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
external_repository: leather-io/playwright-reports
publish_branch: main
publish_dir: ./playwright-report
destination_dir: ${{ steps.extract_branch.outputs.branch }}
- name: Deploy specs.leather.io
uses: peaceiris/actions-gh-pages@v3
if: steps.extract_branch.outputs.branch == 'dev'
with:
personal_token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
external_repository: leather-io/specs.leather.io
publish_branch: main
publish_dir: ./playwright-report
cname: specs.leather.io