This repository has been archived by the owner on Sep 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.yml
156 lines (154 loc) · 4.62 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
workflows:
version: 2
node-multi-build:
jobs:
- gally-create-pr
- test-node-v12:
requires:
- gally-create-pr
- test-node-v10:
requires:
- gally-create-pr
- gally-auto-merge:
requires:
- gally-create-pr
- test-node-v12
- test-node-v10
filters:
branches:
only: /dependabot\/.*/
- release:
requires:
- gally-create-pr
- test-node-v12
- test-node-v10
filters:
branches:
only: master
version: 2
jobs:
gally-create-pr:
docker:
- image: 'circleci/node:12'
steps:
- checkout
- run: sudo yarn global add gally
- run: ga promote $CIRCLE_BRANCH
gally-auto-merge:
docker:
- image: 'circleci/node:12'
steps:
- run:
name: Set PR number
command: >
echo 'export
CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"'
>> $BASH_ENV
source $BASH_ENV
echo $CIRCLE_PR_NUMBER
- checkout
- run: sudo yarn global add gally
- run: >-
ga approve $CIRCLE_PR_NUMBER --condition
"base.ref=dev&state=open&user.login=dependabot-preview[bot]&mergeable=true"
- run: >-
ga merge $CIRCLE_PR_NUMBER --condition
"base.ref=dev&state=open&user.login=dependabot-preview[bot]&mergeable=true"
test-node-v10:
docker:
- image: 'circleci/node:10'
steps:
- checkout
- run:
command: |
# sync submodules as checkout doesn't do this automatically
if [[ $(git config --file .gitmodules --get-regexp path) ]]; then
git submodule sync && git submodule update --init
fi
- run:
command: |
if [[ -n "${NPM_TOKEN}" ]]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
fi
- restore_cache:
name: Restore Yarn Package Cache
keys:
- 'yarn-packages-{{ checksum "yarn.lock" }}'
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: 'yarn-packages-{{ checksum "yarn.lock" }}'
paths:
- ~/.cache/yarn
- run: yarn test
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
release:
docker:
- image: 'circleci/node:12'
steps:
- checkout
- run:
command: |
# sync submodules as checkout doesn't do this automatically
if [[ $(git config --file .gitmodules --get-regexp path) ]]; then
git submodule sync && git submodule update --init
fi
- run:
command: |
if [[ -n "${NPM_TOKEN}" ]]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
fi
- restore_cache:
name: Restore Yarn Package Cache
keys:
- 'yarn-packages-{{ checksum "yarn.lock" }}'
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: 'yarn-packages-{{ checksum "yarn.lock" }}'
paths:
- ~/.cache/yarn
- run: yarn run semantic-release
test-node-v12:
docker:
- image: 'circleci/node:12'
steps:
- checkout
- run:
command: |
# sync submodules as checkout doesn't do this automatically
if [[ $(git config --file .gitmodules --get-regexp path) ]]; then
git submodule sync && git submodule update --init
fi
- run:
command: |
if [[ -n "${NPM_TOKEN}" ]]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
fi
- restore_cache:
name: Restore Yarn Package Cache
keys:
- 'yarn-packages-{{ checksum "yarn.lock" }}'
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: 'yarn-packages-{{ checksum "yarn.lock" }}'
paths:
- ~/.cache/yarn
- run: yarn test
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
- run:
command: |
if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
yarn run coveralls
fi