-
Notifications
You must be signed in to change notification settings - Fork 833
/
config.yml
140 lines (128 loc) · 3.53 KB
/
config.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
####################
# Defaults
####################
defaults: &js_defaults
docker:
- image: circleci/node:lts
environment:
## this enables colors in the output
TERM: xterm
working_directory: ~/material-ui-pickers
version: 2.1
orbs:
cypress: cypress-io/cypress@1.6.0
####################
# Custom jobs
####################
jobs:
checkout_code:
<<: *js_defaults
steps:
- checkout
- persist_to_workspace:
root: .
paths: .
javascript:
<<: *js_defaults
steps:
- attach_workspace:
at: .
- restore_cache:
name: Restore Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache
- run:
name: Typescript
command: yarn workspaces run build:typescript
- run:
name: Eslint
command: yarn lint
- run:
name: Ensure prettier was run
command: yarn prettier --check './**/*.ts*' './**/*.js*'
- run:
name: Build and analyze bundlesize
command: yarn workspace @material-ui/pickers build:analyze
- persist_to_workspace:
root: .
paths: .
jest_tests:
description: Running jest test with separate library
parameters:
lib:
description: "Library to run tests"
type: string
after-tests:
description: "Steps that will be executed after test run is finished"
type: steps
default: []
<<: *js_defaults
steps:
- attach_workspace:
at: .
# --runInBand required to not get out of memory @see https://discuss.circleci.com/t/memory-problems-with-jest-and-workers/10297
- run: cd lib && yarn test:<<parameters.lib>> -- -- --runInBand
- steps: << parameters.after-tests >>
cypress_tests:
description: Run cypress tests
executor: cypress/browsers-chrome69
steps:
- attach_workspace:
at: .
- restore_cache:
name: Restore Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Additional yarn install
command: yarn install --frozen-lockfile
- run:
name: Install, if no cypress binary found
command: yarn cypress install
- run: yarn workspace docs build
- run:
background: true
name: Run docs in background
command: yarn workspace docs start
- run: npx wait-on http://localhost:3000
- run: yarn percy exec -- cypress run --record
####################
# Workflow
####################
workflows:
build_and_test:
jobs:
- checkout_code
- javascript:
name: 'Install deps, lint and build'
requires:
- checkout_code
- cypress_tests:
name: 'Cypress tests'
requires:
- checkout_code
- jest_tests:
name: 'Date-fns jest tests'
lib: date-fns
after-tests:
- run: npx codecov
requires:
- 'Install deps, lint and build'
- jest_tests:
name: 'Moment jest tests'
lib: moment
requires:
- 'Install deps, lint and build'
- jest_tests:
name: 'Luxon jest tests'
lib: luxon
requires:
- 'Install deps, lint and build'