/
config.yml
131 lines (117 loc) · 2.76 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
version: 2.1
defaults: &defaults
working_directory: ~/auto
docker:
- image: circleci/node:12-browsers
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
aliases:
# Circle related commands
- &restore-cache
keys:
# Find a cache corresponding to this specific package.json checksum
# when this file is changed, this key will fail
- auto-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
- auto-{{ checksum "yarn.lock" }}
# Find the most recent cache used from any branch
- auto-
- &save-cache
key: auto-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ~/.cache/yarn
- node_modules
# Yarn commands
- &yarn
name: Install Dependencies
command: yarn install --frozen-lockfile --non-interactive --cache-folder=~/.cache/yarn
- &lint
name: Lint
command: yarn lint
- &test
name: Test
command: yarn test:coverage
- &build
name: Build
command: yarn build
- &bundle
name: Bundle the code into binaries for multiple platforms
command: yarn lerna run bundle --scope=auto
jobs:
install:
<<: *defaults
steps:
- checkout
- restore_cache: *restore-cache
- run: *yarn
- save_cache: *save-cache
- persist_to_workspace:
root: .
paths:
- .
build:
<<: *defaults
steps:
- attach_workspace:
at: ~/auto
- run: *build
- run: *bundle
- persist_to_workspace:
root: .
paths:
- .
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/auto
- run: *lint
pr-check:
<<: *defaults
steps:
- attach_workspace:
at: ~/auto
- run:
name: Check for SemVer Label
command: yarn auto pr-check --url $CIRCLE_BUILD_URL
test:
<<: *defaults
steps:
- attach_workspace:
at: ~/auto
- run: *test
- run:
name: Send CodeCov Results
command: bash <(curl -s https://codecov.io/bash) -t $CODECOV_KEY
release:
<<: *defaults
steps:
- attach_workspace:
at: ~/auto
- run:
name: Add github.com to known hosts
command: mkdir ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
- run:
name: Release
command: yarn auto shipit -vv
workflows:
version: 2
build_and_test:
jobs:
- install
- build:
requires:
- install
- pr-check:
requires:
- build
- lint:
requires:
- build
- test:
requires:
- build
- release:
context: "@auto-canary"
requires:
- test
- lint