1
1
version : 2
2
2
3
+ job_common : &job_common
4
+ docker :
5
+ - image : circleci/node:9.11.2
6
+ working_directory : ~/colonyNetwork
7
+ step_save_cache : &step_save_cache
8
+ save_cache :
9
+ paths :
10
+ - ~/.cache/yarn
11
+ key : node-modules-{{ checksum "yarn.lock" }}
12
+ step_restore_cache : &step_restore_cache
13
+ restore_cache :
14
+ keys :
15
+ - node-modules-{{ checksum "yarn.lock" }}
16
+ - node-modules-
17
+ step_setup_global_packages : &step_setup_global_packages
18
+ run :
19
+ name : " Set up global packages"
20
+ command : |
21
+ yarn --pure-lockfile
22
+ git submodule update --init
23
+ step_setup_greenkeeper : &step_setup_greenkeeper
24
+ run :
25
+ name : " Add greenkeeper-lockfile-update"
26
+ command : yarn global add greenkeeper-lockfile@1
3
27
jobs :
4
- lint-and-unit-test :
5
- docker :
6
- - image : circleci/node:9.11.2
7
- working_directory : ~/colonyNetwork
28
+ greenkeeper-updates :
29
+ << : *job_common
8
30
steps :
9
31
- checkout
10
- - restore_cache :
11
- keys :
12
- - node-modules-{{ checksum "yarn.lock" }}
13
- - node-modules-
32
+ - << : *step_restore_cache
33
+ - << : *step_setup_global_packages
34
+ - << : *step_setup_greenkeeper
14
35
- run :
15
- name : " Set up global packages"
16
- command : |
17
- yarn global add greenkeeper-lockfile@1
18
- yarn --pure-lockfile
19
- git submodule update --init
36
+ name : " Run Greenkeeper lockfile update"
37
+ command : $(yarn global bin)/greenkeeper-lockfile-update
38
+ environment :
39
+ GK_LOCK_YARN_OPTS : " --ignore-workspace-root-check"
40
+ - << : *step_save_cache
41
+ lint-and-unit-test :
42
+ << : *job_common
43
+ steps :
44
+ - checkout
45
+ - << : *step_restore_cache
46
+ - << : *step_setup_global_packages
47
+ - << : *step_setup_greenkeeper
20
48
- run :
21
49
name : " Setup parity"
22
50
command : |
@@ -28,20 +56,11 @@ jobs:
28
56
sed -i "s/xxxxx/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
29
57
sed -i "s/yyyyy/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
30
58
sed -i "s/zzzzz/$(parity --keys-path ./keys --password ./parityPassword account new)/g" ./parity-genesis.json
31
- - save_cache :
32
- paths :
33
- - node_modules
34
- key : node-modules-{{ checksum "yarn.lock" }}
35
59
- run :
36
60
name : " Install lsof"
37
61
command : |
38
62
sudo apt-get update
39
63
sudo apt-get install lsof
40
- - run :
41
- name : " Greenkeeper lockfile update"
42
- command : $(yarn global bin)/greenkeeper-lockfile-update
43
- environment :
44
- GK_LOCK_YARN_OPTS : " --ignore-workspace-root-check"
45
64
- run :
46
65
name : " Linting JavaScript"
47
66
command : yarn run eslint
66
85
- run :
67
86
name : " Running colony-contract-loader-network tests"
68
87
command : cd packages/colony-js-contract-loader-network && yarn run test
88
+ - << : *step_save_cache
69
89
- run :
70
90
name : " Greenkeeper uploading lockfile"
71
91
command : $(yarn global bin)/greenkeeper-lockfile-upload
@@ -74,27 +94,15 @@ jobs:
74
94
path : test-results.xml
75
95
- store_artifacts :
76
96
path : test-results.xml
77
-
78
97
test-coverage :
79
- docker :
80
- - image : circleci/node:9.11.2
81
- working_directory : ~/colonyNetwork
98
+ << : *job_common
82
99
steps :
83
100
- checkout
84
- - restore_cache :
85
- keys :
86
- - node-modules-{{ checksum "yarn.lock" }}
87
- - node-modules-
88
- - run :
89
- name : " Set up global packages"
90
- command : |
91
- yarn global add greenkeeper-lockfile@1
92
- yarn --pure-lockfile
93
- git submodule update --init
101
+ - << : *step_restore_cache
102
+ - << : *step_setup_global_packages
94
103
- run :
95
104
name : " Running unit tests with coverage"
96
105
command : yarn run test:contracts:coverage
97
-
98
106
# Save coverage artifacts
99
107
- store_artifacts :
100
108
path : coverage
@@ -103,5 +111,10 @@ workflows:
103
111
version : 2
104
112
commit :
105
113
jobs :
106
- - lint-and-unit-test
107
- - test-coverage
114
+ - greenkeeper-updates
115
+ - lint-and-unit-test :
116
+ requires :
117
+ - greenkeeper-updates
118
+ - test-coverage :
119
+ requires :
120
+ - greenkeeper-updates
0 commit comments