-
Notifications
You must be signed in to change notification settings - Fork 727
117 lines (115 loc) Β· 4.5 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
115
116
117
name: 'test:cypress'
on:
pull_request:
branches: [main, release, milestone**, test-cypress]
paths:
- 'cypress/**'
- 'packages/**'
- '!packages/**/__test__/**'
- '!packages/**/*.test.[tj]sx?'
- '!packages/**/*.md'
push:
branches: [main, release, milestone**, test-cypress]
paths:
- 'cypress/**'
- 'packages/**'
- '!packages/**/__test__/**'
- '!packages/**/*.test.[tj]sx?'
- '!packages/**/*.md'
- '.github/**/cypress.yml'
jobs:
install:
runs-on: ubuntu-latest
container:
# https://github.com/cypress-io/cypress-docker-images/tree/master/browsers
image: cypress/browsers:node-20.17.0-chrome-128.0.6613.113-1-ff-129.0.2-edge-128.0.2739.42-1
if: ${{ github.repository_owner == 'DouyinFE' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install global packages
run:
npm i -g lerna@^6
corepack enable
- name: Build storybook
run: |
yarn bootstrap
yarn build:lib
yarn build-storybook
- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: storybook-static
if-no-files-found: error
path: storybook
# - name: Reclaim cache directory
# run: chown -R 1001:1001 /github/home/.cache && echo "pwn dat cache"
- name: Cypress install
uses: cypress-io/github-action@v6
with:
# Disable running of tests within install job
runTests: false
chrome-tests:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.17.0-chrome-128.0.6613.113-1-ff-129.0.2-edge-128.0.2739.42-1
options: --user 1001
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download the build folders
uses: actions/download-artifact@v4
with:
name: storybook-static
path: storybook
- name: 'Cypress Tests - Chrome'
uses: cypress-io/github-action@v6
with:
# we have already installed all dependencies above
install: true
start: npx http-server -p 6006 storybook
wait-on: 'http://localhost:6006'
wait-on-timeout: 120
browser: chrome
record: true
parallel: true
group: 'Cypress - Chrome'
spec: cypress/e2e/*
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# firefox-tests:
# runs-on: ubuntu-latest
# container:
# image: cypress/browsers:node18.12.0-chrome103-ff107
# options: --user 1001
# needs: install
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Download the build folders
# uses: actions/download-artifact@v5
# with:
# name: storybook-static
# path: storybook-static
# - name: 'Cypress Tests - Firefox'
# uses: cypress-io/github-action@v5
# with:
# # we have already installed all dependencies above
# install: true
# start: npx http-server -p 6006 storybook-static
# wait-on: 'http://localhost:6006'
# wait-on-timeout: 120
# browser: firefox
# record: true
# parallel: true
# group: 'Cypress - Firefox'
# spec: cypress/e2e/*
# env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# # Recommended: pass the GitHub token lets this action correctly
# # determine the unique run id necessary to re-run the checks
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}