-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (80 loc) · 2.63 KB
/
cypress-tests.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
# https://docs.cypress.io/guides/continuous-integration/github-actions
name: Cypress Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Create and save build
install:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build project
uses: cypress-io/github-action@v6
with:
# Disable running of tests within install job
runTests: false
build: yarn run build
- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
include-hidden-files: true
path: .next
e2e:
runs-on: ubuntu-22.04
needs: install
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download the build folder
uses: actions/download-artifact@v4
with:
name: build
path: .next
- name: Cypress run e2e tests
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
start: yarn start
wait-on: "http://localhost:3000" # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
# record: true
# parallel: true # Runs test in parallel using settings above
browser: chrome
component:
runs-on: ubuntu-22.04
needs: install
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download the build folder
uses: actions/download-artifact@v4
with:
name: build
path: .next
- name: Cypress run component tests
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
# record: true
#parallel: true # Runs test in parallel using settings above
browser: chrome
component: true
# working-directory: examples/component-tests
# spec: components/**/*cy.tsx