-
Notifications
You must be signed in to change notification settings - Fork 25
161 lines (140 loc) · 4.72 KB
/
ci.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Run Test Cases
# command to run tests and generate coverage metrics
run: npm run test:unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittest,chrome
e2e-tests-chrome-desktop:
name: E2E tests on Chrome Desktop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
node_modules
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Cypress
run: npm i cypress
- name: Cypress run
uses: cypress-io/github-action@v3
with:
browser: chrome
install: false
record: true
tag: chrome-desktop
start: npm run serve
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: ui,chrome
e2e-tests-chrome-mobile:
name: E2E tests on Chrome Mobile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
node_modules
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Cypress
run: npm i cypress
- name: Cypress run
uses: cypress-io/github-action@v3
with:
config: "viewportWidth=375,viewportHeight=667"
browser: chrome
install: false
record: true
tag: chrome-mobile
start: npm run serve
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
install-cypress:
name: Install Cypress
runs-on: ubuntu-latest
container: cypress/browsers:node14.17.0-chrome88-ff89
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress install
uses: cypress-io/github-action@v3
with:
runTests: false
e2e-tests-firefox-desktop:
name: E2E tests on Firefox Desktop
runs-on: ubuntu-latest
container:
image: cypress/browsers:node14.17.0-chrome88-ff89
options: --user 1001
needs: install-cypress
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
node_modules
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Cypress
run: npm i cypress
- name: Cypress run
uses: cypress-io/github-action@v3
with:
browser: firefox
install: false
record: true
tag: firefox-desktop
start: npm run serve
wait-on: "http://localhost:8080"
env:
VUE_APP_BACKEND: http://127.0.0.1:8000
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}