1
- name : Cypress
1
+ name : Cypress UI tests
2
2
3
3
on :
4
- merge_group :
5
4
push :
6
- branches-ignore :
7
- - ' release-please-**'
8
5
9
6
jobs :
10
7
cypress-run :
11
- concurrency :
12
- group : cypress-${{ github.head_ref || github.ref }}
8
+ concurrency : cypress-${{ github.head_ref || github.ref }}
13
9
runs-on : ubuntu-latest
14
10
steps :
15
- - name : checkout
16
- uses : actions/checkout@v3
17
-
18
- - name : set up node
19
- uses : actions/setup-node@v3
20
- with :
21
- node-version : ' 18'
11
+ - name : Checkout
12
+ uses : actions/checkout@v4
22
13
23
14
- name : Yarn Install and Cache
24
15
uses : graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
25
16
with :
26
17
cypress : true
27
18
28
- - name : cypress run
29
- uses : cypress-io/github-action@v4
19
+ - name : Build App
20
+ run : yarn build:test
21
+ shell : bash
30
22
env :
31
23
VITE_PORT : 3000
32
- VITE_GRAASP_API_HOST : http://localhost:3636
24
+ VITE_API_HOST : http://localhost:3636
33
25
VITE_GRAASP_APP_KEY : id-1234567890
34
26
VITE_ENABLE_MOCK_API : true
27
+ VITE_VERSION : cypress-tests
28
+
29
+ - name : Cypress Run
30
+ uses : cypress-io/github-action@v5
31
+ env :
32
+ VITE_PORT : 3000
33
+ VITE_API_HOST : http://localhost:3636
34
+ VITE_GRAASP_APP_KEY : id-1234567890
35
+ VITE_ENABLE_MOCK_API : true
36
+ VITE_VERSION : cypress-tests
35
37
with :
36
- wait-on : http://localhost:3000
37
- wait-on-timeout : 180
38
38
install : false
39
- build : yarn build
40
39
config : baseUrl=http://localhost:3000
41
- start : yarn dev
40
+ start : yarn preview:test
42
41
browser : chrome
43
42
quiet : true
44
43
# point to new cypress@10 config file
45
44
config-file : cypress.config.ts
46
45
47
- # component tests are not running ok in the CI
48
- # - name: Run Component tests 🧪
49
- # uses: cypress-io/github-action@v4
50
- # with:
51
- # # we have already installed everything
52
- # install: false
53
- # # to run component tests we need to use "component: true"
54
- # component: true
55
-
56
- # after the test run completes
57
- # store videos and any screenshots
58
- # NOTE: screenshots will be generated only if E2E test failed
59
- # thus we store screenshots only on failures
60
- # Alternative: create and commit an empty cypress/screenshots folder
61
- # to always have something to upload
62
- - uses : actions/upload-artifact@v3
46
+ - uses : actions/upload-artifact@v4
63
47
if : failure()
64
48
with :
65
49
name : cypress-screenshots
66
50
path : cypress/screenshots
67
51
68
- - uses : actions/upload-artifact@v3
69
- if : failure()
70
- with :
71
- name : cypress-videos
72
- path : cypress/videos
73
-
74
52
- name : coverage report
75
53
run : npx nyc report --reporter=text-summary
76
54
88
66
GITHUB_TOKEN : ${{ github.token }}
89
67
REPO_PATH : ${{ github.repository }}
90
68
COMMIT_SHA : ${{ github.sha }}
91
- RUN_ID : ${{ github.run_id }}
69
+ RUN_ID : ${{ github.run_id }}
0 commit comments