-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (66 loc) · 2.31 KB
/
e2e.yaml
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
name: End-to-end tests
on:
pull_request:
jobs:
# TODO: share setup action between test and e2e
e2e:
runs-on: ubuntu-latest
container: cypress/browsers:node-20.10.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
# https://github.com/pnpm/action-setup
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-v1-
- uses: actions/cache@v3
name: Setup Cypress cache
with:
path: /github/home/.cache/Cypress
key: ${{ runner.os }}-cypress-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-cypress-v2-
- name: Install dependencies
run: pnpm install
- name: Build core
working-directory: packages/core
run: pnpm build
- name: Build viewer
working-directory: packages/viewer
run: |
VITE_BUNDLE_HOST=http://localhost:4173 pnpm run build
- name: Copy fixtures
working-directory: packages/viewer
# The viewer build is configured to load data from the local server's
# static assets, so we populate the main branch location with fixture
# data, for deterministic testing.
run: |
mkdir -p dist/refs/heads
cp cypress/fixtures/main.min.json dist/refs/heads/main.json
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: chrome
build: echo "Start runs build"
command: pnpm --filter viewer run cy:run --config baseUrl=http://localhost:4173
start: pnpm --filter viewer run preview
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}