-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
158 lines (131 loc) · 4.67 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
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
# Automate, customize, and execute your software development workflows right in your repository with GitHub Actions.
# Documentation: https://docs.github.com/en/actions
name: build
on:
push:
branches:
- main
- develop
- release/*
pull_request:
branches:
- main
- develop
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Load cached dependencies
uses: actions/[email protected]
id: cache
with:
path: |
**/node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
id: install-dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
# - name: Fix code style linting errors
# id: lint-fix
# run: npm run lint:fix
# continue-on-error: true
#
# - name: Commit fixed linting errors
# id: commit
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "ci: fix code style linting errors"
- name: Lint code
id: lint
run: npm run lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
test-spec:
- { name: "Integration", spec: "./tests/cypress/integration/**/*.spec.{js,ts}" }
#- { name: "Demos/Commands", spec: "./demos/src/Commands/**/*.spec.{js,ts}" }
- { name: "Demos/Examples", spec: "./demos/src/Examples/**/*.spec.{js,ts}" }
- { name: "Demos/Experiments", spec: "./demos/src/Experiments/**/*.spec.{js,ts}" }
- { name: "Demos/Extensions", spec: "./demos/src/Extensions/**/*.spec.{js,ts}" }
- { name: "Demos/GuideContent", spec: "./demos/src/GuideContent/**/*.spec.{js,ts}" }
- { name: "Demos/GuideGettingStarted", spec: "./demos/src/GuideGettingStarted/**/*.spec.{js,ts}" }
#- { name: "Demos/GuideNodeViews", "./demos/src/GuideNodeViews/**/*.spec.{js,ts}" }
- { name: "Demos/Marks", spec: "./demos/src/Marks/**/*.spec.{js,ts}" }
- { name: "Demos/Nodes", spec: "./demos/src/Nodes/**/*.spec.{js,ts}" }
#- { name: "Demos/Overview", spec: "./demos/src/Overview/**/*.spec.{js,ts}" }
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
id: install-dependencies
run: npm install
- name: Try to build the packages
id: build-packages
run: npm run build:pm
- name: Test ${{ matrix.test-spec.name }}
id: cypress
uses: cypress-io/[email protected]
with:
cache-key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
start: npm run start
wait-on: 'http://localhost:3000'
spec: ${{ matrix.test-spec.spec }}
project: ./tests
browser: chrome
quiet: true
- name: Export screenshots (on failure only)
uses: actions/[email protected]
if: failure()
with:
name: cypress-screenshots
path: tests/cypress/screenshots
retention-days: 7
- name: Export screen recordings (on failure only)
uses: actions/[email protected]
if: failure()
with:
name: cypress-videos
path: tests/cypress/videos
retention-days: 7
build:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Load cached dependencies
uses: actions/[email protected]
id: cache
with:
path: |
**/node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
id: install-dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
- name: Try to build the packages
id: build-packages
run: npm run build:ci