-
Notifications
You must be signed in to change notification settings - Fork 3
138 lines (136 loc) · 4.57 KB
/
partial-test.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
132
133
134
135
136
137
138
name: Test Only @scoped
on:
push:
branches:
- '*/*'
- '!master'
- '!develop'
paths:
- 'src/**'
- 'tests/**'
- 'playwright.config.ts'
- 'pnpm-lock.yaml'
workflow_dispatch:
inputs:
debug:
description: 'Enable debug logging'
required: false
default: 'false'
jobs:
fast-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chrome, edge, chromium]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build And Package Extensions
run: pnpm build --zip --target=${{ matrix.browser }}-mv3
env:
DEBUG: true
# upload to github artifacts for each browser with matrix
- name: Upload to GitHub Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}-mv3
path: build/
fast-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [units, integrations]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm exec playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Test
id: test
run: |
pnpm test -- --project=${{ matrix.project }} \
--grep=@scoped \
--pass-with-no-tests \
--global-timeout=3600000 \
--max-failures=2 \
--retries=3
env:
DEBUG: true
fast-e2e-test:
runs-on: ubuntu-latest
needs: fast-test
strategy:
fail-fast: false
matrix:
browser: [chrome, edge]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build Extension and Prepare Tests
run: pnpm test:rebuild
env:
DEBUG: true
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm exec playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Test
id: test
run: |
pnpm test -- --project=${{ matrix.browser }} \
--grep=@scoped \
--pass-with-no-tests \
--global-timeout=3600000 \
--timeout=60000 \
--max-failures=5 \
--retries=3
env:
DEBUG: true
- name: Upload Test Results
if: failure() && steps.test.conclusion != 'skipped'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}-test-results
path: |
test-results/
playwright-report/
if-no-files-found: ignore