-
Notifications
You must be signed in to change notification settings - Fork 6
152 lines (145 loc) · 4.25 KB
/
pull-request-master.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
name: Master Pull Request
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- converted_to_draft
branches:
- master
concurrency:
group: ci-tests-${{ github.ref }}-1
cancel-in-progress: true
jobs:
build:
timeout-minutes: 15
if: github.event.pull_request.draft == false
name: Build
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --network-timeout 100000
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: yarn lerna run build --stream --concurrency=15 --include-dependencies
- run: tar -zcf /tmp/vivid-env.tar.gz .
- uses: actions/upload-artifact@v2
with:
name: workspace
path: /tmp/vivid-env.tar.gz
test:
if: github.event.pull_request.draft == false
needs: build
name: "Test Components on ${{ matrix.browser_name }}"
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }}
strategy:
max-parallel: 10
matrix:
os:
- ubuntu-20.04
- macos-latest
browser:
- SafariNative
- ChromeHeadless
- FirefoxHeadless
exclude:
- os: ubuntu-20.04
browser: SafariNative
- os: macos-latest
browser: FirefoxHeadless
- os: macos-latest
browser: ChromeHeadless
include:
- browser: ChromeHeadless
browser_name: Chrome
report_coverage: true
- browser: FirefoxHeadless
browser_name: Firefox
report_coverage: false
- browser: SafariNative
browser_name: Safari
report_coverage: false
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/download-artifact@v2
with:
name: workspace
path: /tmp
- run: tar -zxf /tmp/vivid-env.tar.gz
- run: yarn karma start --coverage --browsers=${{ matrix.browser }}
id: test
- uses: coverallsapp/github-action@master
name: Report coverage information to coveralls
if: ${{ matrix.report_coverage }}
continue-on-error: true
with:
parallel: false
github-token: ${{ github.token }}
path-to-lcov: ./coverage/report-lcov/lcov.info
flag-name: Tested on ${{ matrix.os }} / ${{ matrix.browser }}
- run: exit 0
if: ${{ steps.test.outcome == 'success' }}
test_for_visual_regression:
if: github.event.pull_request.draft == false
needs: build
name: Test Components Graphics
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }}
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/download-artifact@v2
with:
name: workspace
path: /tmp
- run: tar -zxf /tmp/vivid-env.tar.gz
- run: npm rebuild playwright && yarn playwright install-deps
- run: yarn ui-tests
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: snapshot
path: ./ui-tests/snapshots/*.png
test_static:
if: github.event.pull_request.draft == false
needs: build
name: ${{ matrix.script_name }}
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }}
strategy:
max-parallel: 10
matrix:
script:
- lint
include:
- script: lint
script_name: Test Lint rules
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/download-artifact@v2
with:
name: workspace
path: /tmp
- run: tar -zxf /tmp/vivid-env.tar.gz
- run: yarn ${{ matrix.script }}