-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (84 loc) · 2.85 KB
/
js_test.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
name: Javascript testing
on:
- push
- pull_request
jobs:
test:
name: Run unit tests using Vue Test Utils
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Export node version
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Node Information
run: node --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencides
run: >-
npm ci --legacy-peer-deps
- name: Run unit tests
run: >-
npm run test:unit
cypress:
name: Run Cypress tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Export node version
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Node Information
run: node --version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}x
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencides
run: >-
npm ci --legacy-peer-deps
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run serve --legacy-peer-deps
wait-on: http://localhost:8080/
spec: "tests/e2e/**/*"
config-file: cypress.config.js
config: video=false
install: false
timeout-minutes: 5
browser: chrome
# 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
# Alternative: create and commit an empty cypress/screenshots folder
# to always have something to upload
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: tests/e2e/screenshots