-
Notifications
You must be signed in to change notification settings - Fork 33
155 lines (123 loc) · 4.6 KB
/
Copy pathlint-test.yml
File metadata and controls
155 lines (123 loc) · 4.6 KB
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
name: Lint & Test
on:
pull_request: # for PRs from forks
push:
branches-ignore:
- 'update-snapshots'
workflow_dispatch:
inputs:
updateSnapshots:
description: 'Update Cypress snapshots'
default: false
type: boolean
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: Checkout 🏷️
uses: actions/checkout@v6
- name: Install ⚙️
uses: ./.github/actions/install
- name: Lint 🤓
run: pnpm lint
test:
runs-on: ubuntu-latest
# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: Checkout 🏷️
uses: actions/checkout@v6
- name: Install ⚙️
uses: ./.github/actions/install
- name: Restore Playwright cache 📌
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-
- name: Install Playwright browser ⚙️
run: pnpm exec playwright install chromium
- name: Set up Python 🕹️
id: setup-python
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Restore Poetry installation 📌
id: poetry
uses: actions/cache@v5
with:
path: ~/.local
key: poetry-5 # increment to reset cache
- name: Install Poetry 📜
if: steps.poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: 2.2.1
- name: Restore Poetry cache 📌
uses: actions/cache@v5
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-1 # increment to reset cache
- name: Create Poetry environments 📜
run: pnpm support:setup
- name: Create sample HDF5 file 🎨
run: pnpm support:sample
- name: Start h5grove support server 🔌
run: pnpm support:h5grove & pnpm wait-on http://localhost:8888 -t 1m
- name: Test 👓
run: pnpm test:headless
- name: Upload debug screenshots on failure 🖼️
uses: actions/upload-artifact@v7
if: failure()
with:
name: vitest
path: packages/app/src/__tests__/__screenshots__/
packages:
runs-on: ubuntu-latest
# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: Checkout 🏷️
uses: actions/checkout@v6
- name: Install ⚙️
uses: ./.github/actions/install
- name: Build packages 📦
run: pnpm packages
e2e:
runs-on: ubuntu-latest
# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: Checkout 🏷️
uses: actions/checkout@v6
- name: Install ⚙️
uses: ./.github/actions/install
- name: Build demo 🛠️
run: pnpm build
- name: Serve ⚡️
run: pnpm serve & pnpm wait-on http://localhost:5173 -t 1m
- name: Run Cypress 🌳
run: pnpm cypress:run --env ${{ inputs.updateSnapshots && 'updateSnapshots=true' || 'requireSnapshots=true' }} --expose takeSnapshots=true
- name: Upload debug screenshots and diffs on failure 🖼️
uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress
path: |
cypress/debug/
cypress/snapshots/**/__diff_output__/
cypress/snapshots/**/__received_output__/
- name: Open PR to update reference snapshots 🎁
uses: peter-evans/create-pull-request@v8
if: ${{ inputs.updateSnapshots }}
with:
token: ${{ secrets.USER_TOKEN }}
branch: update-snapshots
delete-branch: true
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> # https://github.com/peter-evans/create-pull-request/blob/v8/action.yml#L27
title: 'Update Cypress reference snapshots'
commit-message: 'Update Cypress reference snapshots'