This repository has been archived by the owner on Nov 28, 2024. It is now read-only.
generated from graasp/graasp-repo
-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (67 loc) · 2.26 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
name: Cypress CI
on:
push:
branches:
- 'main'
pull_request:
merge_group:
concurrency:
group: cypress-${{ github.ref }}
cancel-in-progress: false
jobs:
cypress:
name: Cypress
runs-on: ubuntu-latest
steps:
# Check-out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Check out code
uses: actions/checkout@v4
- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
with:
cypress: true
# type check
- name: Type-check code
run: tsc --noEmit
- name: Build App
run: NODE_OPTIONS=--max-old-space-size=4096 yarn build:test
shell: bash
env:
VITE_PORT: 3112
VITE_VERSION: cypress-tests
VITE_GRAASP_DOMAIN: localhost
VITE_GRAASP_API_HOST: http://localhost:3636
VITE_GRAASP_AUTH_HOST: http://localhost:3001
VITE_GRAASP_BUILDER_HOST: http://localhost:3111
VITE_GRAASP_ANALYTICS_HOST: http://localhost:3113
VITE_SHOW_NOTIFICATIONS: false
# use the Cypress GitHub Action to run Cypress tests within the chrome browser
- name: Cypress run
uses: cypress-io/github-action@v6
with:
install: false
start: yarn preview:test
browser: chrome
quiet: true
config-file: cypress.config.ts
cache-key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
env:
VITE_PORT: 3112
VITE_VERSION: cypress-tests
VITE_GRAASP_DOMAIN: localhost
VITE_GRAASP_API_HOST: http://localhost:3636
VITE_GRAASP_AUTH_HOST: http://localhost:3001
VITE_GRAASP_BUILDER_HOST: http://localhost:3111
VITE_GRAASP_ANALYTICS_HOST: http://localhost:3113
VITE_SHOW_NOTIFICATIONS: false
# after the test run completes
# store any screenshots
# NOTE: screenshots will be generated only if E2E test failed
# thus we store screenshots only on failures
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: coverage report
run: npx nyc report --reporter=text-summary