-
Notifications
You must be signed in to change notification settings - Fork 12
102 lines (87 loc) · 2.58 KB
/
ci.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
name: ci
on:
push:
branches: main
pull_request:
branches: main
env:
CI: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 18.6.0
- uses: pnpm/action-setup@v2.4.0
with:
version: latest
run_install: false
- name: get pnpm store directory
id: pnpm-cache
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: load cache
uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: install dependencies
run: pnpm install
- name: build packs
run: pnpm build
- name: run lint test
run: pnpm lint
- name: setup firefox
uses: browser-actions/setup-firefox@latest
with:
firefox-version: latest-esr
- name: run e2e test on chrome
uses: cypress-io/github-action@v4
env:
CYPRESS_SERVER_PORT: 7000
CYPRESS_PORT: 8000
with:
install: false
working-directory: e2e
start: pnpm exec vite preview --port 7000 --host
wait-on: 'http://localhost:7000'
browser: chrome
- name: run e2e test on firefox
uses: cypress-io/github-action@v4
env:
CYPRESS_SERVER_PORT: 7001
CYPRESS_PORT: 8000
with:
install: false
working-directory: e2e
start: pnpm exec vite preview --port 7001 --host
wait-on: 'http://localhost:7001'
browser: firefox
- name: create versions or publish to npm registry
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'ci(changeset): release prosemirror-adapter'
env:
GITHUB_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: export screenshots (on failure only)
uses: actions/upload-artifact@v3.1.3
if: ${{ failure() }}
with:
name: cypress-screenshots
path: e2e/cypress/screenshots
retention-days: 7
- name: export screen recordings (on failure only)
uses: actions/upload-artifact@v3.1.3
if: ${{ failure() }}
with:
name: cypress-videos
path: e2e/cypress/videos
retention-days: 7