-
-
Notifications
You must be signed in to change notification settings - Fork 24
114 lines (97 loc) · 3.24 KB
/
cypress.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
name: E2E Tests (Cypress)
on:
push:
branches:
- master
- next
pull_request:
branches:
- '**'
paths-ignore:
- "**.md"
- "!.github/workflows/ci.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run:
strategy:
fail-fast: false
matrix:
node: [20]
platform:
- ubuntu-latest
name: '${{matrix.platform}} / Node ${{ matrix.node }}'
runs-on: ${{matrix.platform}}
if: ${{ !startsWith(github.event.head_commit.message, 'docs:') }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: true
- run: pnpm --version
- name: TSC Build (esm)
run: pnpm predev
- name: Website Dev Build (served for Cypress)
run: pnpm build:dev
- name: Start HTTP Server
run: pnpm serve:demo &
- name: Run Cypress E2E tests
uses: cypress-io/github-action@v6
with:
install: false
# working-directory: packages/dnd
start: pnpm serve:demo
# start: pnpm serve:vite
wait-on: 'http://localhost:8888'
config-file: test/cypress.config.ts
browser: chrome
record: true
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Cypress_extended: true
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: test/cypress/screenshots
# deploy (re-publish) GitHub demo page with a Prod build but only when merging to "master" branch
# and the commit message contains the text "chore(release)"
- name: Website Prod Build (GitHub demo site)
run: pnpm build:demo
if: |
github.ref == 'refs/heads/master' &&
(contains(github.event.head_commit.message, 'chore(release)') || contains(github.event.head_commit.message, '[refresh gh-pages]'))
- name: Deploy to gh-pages
if: |
github.ref == 'refs/heads/master' &&
(contains(github.event.head_commit.message, 'chore(release)') || contains(github.event.head_commit.message, '[refresh gh-pages]'))
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website