@@ -32,11 +32,12 @@ default_environment: &default_environment
32
32
CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
33
33
CIRCLE_ARTIFACTS : /tmp/circleci-artifacts
34
34
GIT_PAGER : cat
35
+ IPFS_CHECK_RCMGR_DEFAULTS : 1
35
36
36
37
executors :
37
38
golang :
38
39
docker :
39
- - image : cimg/go:1.16.15
40
+ - image : cimg/go:1.18.3
40
41
working_directory : ~/ipfs/go-ipfs
41
42
environment :
42
43
<< : *default_environment
@@ -61,14 +62,15 @@ executors:
61
62
E2E_IPFSD_TYPE : go
62
63
dockerizer :
63
64
docker :
64
- - image : cimg/go:1.16.15
65
+ - image : cimg/go:1.18.3
65
66
environment :
66
67
IMAGE_NAME : ipfs/go-ipfs
67
68
WIP_IMAGE_TAG : wip
68
69
69
70
jobs :
70
71
gobuild :
71
72
executor : golang
73
+ resource_class : 2xlarge+
72
74
steps :
73
75
- checkout
74
76
- *make_out_dirs
@@ -106,7 +108,10 @@ jobs:
106
108
command : bash <(curl -s https://codecov.io/bash) -cF unittests -X search -f coverage/unit_tests.coverprofile
107
109
- run :
108
110
command : |
109
- # we want to test the examples against the current version of go-ipfs
111
+ # we want to first test with the go-ipfs in the go.mod file
112
+ go test -v ./...
113
+
114
+ # we also want to test the examples against the current version of go-ipfs
110
115
# however, that version might be in a fork so we need to replace the dependency
111
116
112
117
# backup the go.mod and go.sum files to restore them after we run the tests
@@ -116,11 +121,18 @@ jobs:
116
121
# make sure the examples run against the current version of go-ipfs
117
122
go mod edit -replace github.com/ipfs/go-ipfs=./../../..
118
123
go mod tidy
124
+
125
+ # use the internal config package when we test the current version of go-ipfs
126
+ sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/go-ipfs/config";' ./main.go
127
+
119
128
go test -v ./...
120
129
121
130
# restore the go.mod and go.sum files to their original state
122
131
mv go.mod.bak go.mod
123
132
mv go.sum.bak go.sum
133
+
134
+ # restore the main.go to its original state
135
+ mv main.go.bak main.go
124
136
working_directory : ~/ipfs/go-ipfs/docs/examples/go-ipfs-as-a-library
125
137
126
138
- run :
@@ -143,15 +155,15 @@ jobs:
143
155
working_directory : ~/ipfs/go-ipfs
144
156
environment :
145
157
<< : *default_environment
146
- TEST_NO_DOCKER : 1
158
+ TEST_NO_DOCKER : 0
147
159
TEST_NO_FUSE : 1
148
160
TEST_VERBOSE : 1
149
161
steps :
150
162
- run : sudo apt update
151
163
- run : |
152
164
mkdir ~/localgo && cd ~/localgo
153
- wget https://golang.org/dl/go1.16.15 .linux-amd64.tar.gz
154
- tar xfz go1.16.15 .linux-amd64.tar.gz
165
+ wget https://golang.org/dl/go1.18.3 .linux-amd64.tar.gz
166
+ tar xfz go1.18.3 .linux-amd64.tar.gz
155
167
echo "export PATH=$(pwd)/go/bin:\$PATH" >> ~/.bashrc
156
168
- run : go version
157
169
- run : sudo apt install socat net-tools
@@ -166,7 +178,7 @@ jobs:
166
178
git checkout FETCH_HEAD
167
179
- run :
168
180
cd rb-pinning-service-api &&
169
- docker-compose pull &&
181
+ (for i in {1..3}; do docker-compose pull && break || sleep 5; done) &&
170
182
docker-compose up -d
171
183
172
184
- *make_out_dirs
@@ -217,33 +229,43 @@ jobs:
217
229
- *store_gomod
218
230
interop :
219
231
docker :
220
- - image : cimg/go:1.16 -node
232
+ - image : cimg/go:1.18.3 -node
221
233
parallelism : 4
234
+ resource_class : large
222
235
steps :
223
236
- *make_out_dirs
224
237
- attach_workspace :
225
238
at : /tmp/circleci-workspace
239
+ - restore_cache :
240
+ keys :
241
+ - v1-interop-{{ .Branch }}-{{ .Revision }}
242
+ - v1-interop-{{ .Branch }}-
243
+ - v1-interop-
226
244
- run :
227
245
name : Installing dependencies
228
246
command : |
229
247
npm init -y
230
248
npm install ipfs@^0.61.0
231
- npm install ipfs-interop@^8.0.0
249
+ npm install ipfs-interop@^8.0.10
232
250
233
251
working_directory : ~/ipfs/go-ipfs/interop
234
252
- run :
235
253
name : Running tests
236
254
command : |
237
255
mkdir -p /tmp/test-results/interop/
238
256
export MOCHA_FILE="$(mktemp /tmp/test-results/interop/unit.XXXXXX.xml)"
239
- npx ipfs-interop -- -t node -f $(sed -n -e "s|^require( '\(.*\)') $|test/\1|p" node_modules/ipfs-interop/test/node.js | circleci tests split) -- --reporter mocha-circleci-reporter
257
+ npx ipfs-interop -- -t node -f $(sed -n -e "s|^import '\(.*\)'$|test/\1|p" node_modules/ipfs-interop/test/node.js | circleci tests split --split-by=timings ) -- --reporter mocha-circleci-reporter
240
258
working_directory : ~/ipfs/go-ipfs/interop
241
259
environment :
242
260
LIBP2P_TCP_REUSEPORT : false
243
261
LIBP2P_ALLOW_WEAK_RSA_KEYS : 1
244
262
IPFS_GO_EXEC : /tmp/circleci-workspace/bin/ipfs
245
263
- store_test_results :
246
264
path : /tmp/test-results
265
+ - save_cache :
266
+ key : v1-interop-{{ .Branch }}-{{ .Revision }}
267
+ paths :
268
+ - ~/ipfs/go-ipfs/interop/node_modules
247
269
go-ipfs-api :
248
270
executor : golang
249
271
steps :
@@ -271,7 +293,7 @@ jobs:
271
293
- v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
272
294
- v1-go-api-
273
295
- run :
274
- command : go test -v ./...
296
+ command : go test -count=1 - v ./...
275
297
working_directory : ~/ipfs/go-ipfs/go-ipfs-api
276
298
- save_cache :
277
299
key : v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
@@ -292,18 +314,15 @@ jobs:
292
314
command : |
293
315
git clone https://github.com/ipfs/go-ipfs-http-client.git
294
316
git -C go-ipfs-http-client log -1
295
- cd go-ipfs-http-client
296
- git checkout v0.2.0
297
- cd ..
298
317
- restore_cache :
299
318
keys :
300
319
- v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
301
320
- v1-http-client-
302
321
- run :
303
- name : go test -v ./...
322
+ name : go test -count=1 - v ./...
304
323
command : |
305
324
export PATH=/tmp/circleci-workspace/bin:$PATH
306
- go test -v ./...
325
+ go test -count=1 - v ./...
307
326
working_directory : ~/ipfs/go-ipfs/go-ipfs-http-client
308
327
- save_cache :
309
328
key : v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
@@ -329,6 +348,7 @@ jobs:
329
348
name : Installing dependencies
330
349
command : |
331
350
npm install
351
+ npx playwright install
332
352
working_directory : ~/ipfs/go-ipfs/ipfs-webui
333
353
- run :
334
354
name : Running upstream tests (finish early if they fail)
@@ -344,6 +364,7 @@ jobs:
344
364
- save_cache :
345
365
key : v1-ipfs-webui-{{ checksum "~/ipfs/go-ipfs/ipfs-webui/package-lock.json" }}
346
366
paths :
367
+ - ~/.cache/ms-playwright
347
368
- ~/ipfs/go-ipfs/ipfs-webui/node_modules
348
369
# We only run build as a test here. DockerHub images are built and published
349
370
# by Github Action now: https://github.com/ipfs/go-ipfs/pull/8467
0 commit comments