-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
80 lines (67 loc) · 1.86 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
browser: [chrome, firefox]
steps:
- uses: actions/checkout@v1
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Yarn
run: npm i yarn --global
- name: Install Dependencies
uses: cypress-io/github-action@v1
with:
runTests: false
- name: Run Build
run: yarn build
- name: Upload Build as Artifact
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
- name: Run Unit Tests
run: |
yarn test --coverage
- name: Upload Test Results
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
- uses: cypress-io/github-action@v1
with:
browser: ${{ matrix.browser }}
group: ${{ matrix.browser }}
headless: true
command-prefix: 'percy exec -- npx'
start: yarn dev
wait-on: 'http://localhost:9000'
install: false
working-directory: cypress
parallel: true
parallelism: 4
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- name: Upload cypress screenshots
uses: actions/upload-artifact@master
with:
name: cypress-screenshots
path: cypress/screenshots
if: failure()
- name: Upload cypress videos
uses: actions/upload-artifact@master
if: always()
with:
name: cypress-videos
path: cypress/videos
- name: Post Upload Test Results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true