-
Notifications
You must be signed in to change notification settings - Fork 7
176 lines (143 loc) · 4.28 KB
/
verify.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Verify changes
on:
pull_request:
push:
branches:
- main
- 'release/**'
jobs:
branch-info:
name: Branch Info
runs-on: ubuntu-latest
steps:
- name: Get base branch
id: get-base-branch
run: |
if [[ "${{github.event.pull_request.base.ref}}" != "" ]]; then
echo "BRANCH=${{github.event.pull_request.base.ref}}" >> $GITHUB_OUTPUT
else
echo "BRANCH=main" >> $GITHUB_OUTPUT
fi
outputs:
base-branch: ${{ steps.get-base-branch.outputs.BRANCH }}
lint:
name: Lint
needs: [branch-info]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: ${{needs.branch-info.outputs.base-branch}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: Lint
run: pnpm lint:ci
test:
name: Test
needs: [branch-info]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: ${{needs.branch-info.outputs.base-branch}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: Test
run: pnpm test:packages
e2e:
name: e2e
needs: [branch-info]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: ${{needs.branch-info.outputs.base-branch}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: Get Playwright Version
id: get-version
run: |
echo "VERSION=$(pnpm playwright --version)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Browsers
id: cache-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.get-version.outputs.VERSION }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright
if: steps.cache-browsers.outputs.cache-hit != 'true'
run: pnpm playwright install
- name: SSR
run: pnpm e2e:ssr
- 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
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: always()
needs: [e2e]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install
- 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: pnpm playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v3
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14