ci: test the http clients
Steven Allen committed
Jul 9, 2019 at 20:15 UTC
3588887436c8fc60f9b71240a028df1a58b3e515
1 file changed
+59
-9
.circleci/config.yml
+59
-9
@@ -120,7 +120,7 @@ jobs:
120
path: /tmp/circleci-artifacts
121
- store_artifacts:
122
path: /tmp/circleci-test-results
123
- build-interop:
123
+ build:
124
docker:
125
- image: circleci/golang:1.12
126
<<: *defaults
@@ -128,12 +128,18 @@ jobs:
128
- checkout
129
- *make_out_dirs
130
- *restore_gomod
131
- - run: make build
132
- - run: cp cmd/ipfs/ipfs /tmp/circleci-workspace
131
+ - run:
132
+ name: Building
133
+ command: make build
134
+ - run:
135
+ name: Storing
136
+ command: |
137
+ mkdir -p /tmp/circleci-workspace/bin
138
+ cp cmd/ipfs/ipfs /tmp/circleci-workspace/bin
139
- persist_to_workspace:
140
root: /tmp/circleci-workspace
141
paths:
136
- - ipfs
142
+ - bin/ipfs
143
- *store_gomod
144
interop:
145
docker:
@@ -148,13 +154,51 @@ jobs:
154
command: npm install
155
working_directory: ~/ipfs/go-ipfs/interop
156
environment:
151
- IPFS_GO_EXEC: /tmp/circleci-workspace/ipfs
157
+ IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
158
- run:
159
command: npm test
160
working_directory: ~/ipfs/go-ipfs/interop
161
environment:
156
- IPFS_GO_EXEC: /tmp/circleci-workspace/ipfs
157
-
162
+ IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
163
+ go-ipfs-api:
164
+ docker:
165
+ - image: circleci/golang:1.12
166
+ <<: *defaults
167
+ steps:
168
+ - *make_out_dirs
169
+ - attach_workspace:
170
+ at: /tmp/circleci-workspace
171
+ - run: git clone https://github.com/ipfs/go-ipfs-api.git
172
+ - run:
173
+ name: IPFS Daemon
174
+ command: /tmp/circleci-workspace/bin/ipfs daemon --init --enable-namesys-pubsub
175
+ background: true
176
+ - run:
177
+ name: Waiting for the daemon
178
+ no_output_timeout: 10s
179
+ command: |
180
+ while ! /tmp/circleci-workspace/bin/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do
181
+ sleep 1
182
+ done
183
+ - run:
184
+ command: go test -v ./...
185
+ working_directory: ~/ipfs/go-ipfs/go-ipfs-api
186
+ go-ipfs-http-client:
187
+ docker:
188
+ - image: circleci/golang:1.12
189
+ <<: *defaults
190
+ steps:
191
+ - *make_out_dirs
192
+ - attach_workspace:
193
+ at: /tmp/circleci-workspace
194
+ - run: git clone https://github.com/ipfs/go-ipfs-http-client.git
195
+ - run:
196
+ command: |
197
+ export PATH=/tmp/circleci-workspace/bin:$PATH
198
+ go test -v ./...
199
+ working_directory: ~/ipfs/go-ipfs/go-ipfs-http-client
200
+ - run:
201
+ command: /tmp/circleci-workspace/bin/ipfs shutdown
202
203
workflows:
204
version: 2
@@ -164,7 +208,13 @@ workflows:
208
- golint
209
- gotest
210
- sharness
167
- - build-interop
211
+ - build
212
- interop:
213
requires:
170
- - build-interop
214
+ - build
215
+ - go-ipfs-api:
216
+ requires:
217
+ - build
218
+ - go-ipfs-http-client:
219
+ requires:
220
+ - build