提交 e32a4139 作者: Steven Allen

ci: improve caching

上级 1791f686
...@@ -150,11 +150,19 @@ jobs: ...@@ -150,11 +150,19 @@ jobs:
- attach_workspace: - attach_workspace:
at: /tmp/circleci-workspace at: /tmp/circleci-workspace
- run: git clone https://github.com/ipfs/interop.git - run: git clone https://github.com/ipfs/interop.git
- restore_cache:
keys:
- v1-interop-{{ checksum "~/ipfs/go-ipfs/interop/package-lock.json" }}
- v1-interop-
- run: - run:
command: npm install command: npm install
working_directory: ~/ipfs/go-ipfs/interop working_directory: ~/ipfs/go-ipfs/interop
environment: environment:
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
- save_cache:
key: v1-interop-{{ checksum "~/ipfs/go-ipfs/interop/package-lock.json" }}
paths:
- ~/ipfs/go-ipfs/interop/node_modules
- run: - run:
command: npm test command: npm test
working_directory: ~/ipfs/go-ipfs/interop working_directory: ~/ipfs/go-ipfs/interop
...@@ -168,9 +176,11 @@ jobs: ...@@ -168,9 +176,11 @@ jobs:
- *make_out_dirs - *make_out_dirs
- attach_workspace: - attach_workspace:
at: /tmp/circleci-workspace at: /tmp/circleci-workspace
- run: git clone https://github.com/ipfs/go-ipfs-api.git
- run: - run:
name: IPFS Daemon name: Cloning
command: git clone https://github.com/ipfs/go-ipfs-api.git
- run:
name: Starting the daemon
command: /tmp/circleci-workspace/bin/ipfs daemon --init --enable-namesys-pubsub command: /tmp/circleci-workspace/bin/ipfs daemon --init --enable-namesys-pubsub
background: true background: true
- run: - run:
...@@ -180,9 +190,21 @@ jobs: ...@@ -180,9 +190,21 @@ jobs:
while ! /tmp/circleci-workspace/bin/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do while ! /tmp/circleci-workspace/bin/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do
sleep 1 sleep 1
done done
- restore_cache:
keys:
- v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
- v1-go-api-
- run: - run:
command: go test -v ./... command: go test -v ./...
working_directory: ~/ipfs/go-ipfs/go-ipfs-api working_directory: ~/ipfs/go-ipfs/go-ipfs-api
- save_cache:
key: v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
paths:
- ~/go/pkg/mod
- ~/.cache/go-build/
- run:
name: Stopping the daemon
command: /tmp/circleci-workspace/bin/ipfs shutdown
go-ipfs-http-client: go-ipfs-http-client:
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
...@@ -191,15 +213,24 @@ jobs: ...@@ -191,15 +213,24 @@ jobs:
- *make_out_dirs - *make_out_dirs
- attach_workspace: - attach_workspace:
at: /tmp/circleci-workspace at: /tmp/circleci-workspace
- run: git clone https://github.com/ipfs/go-ipfs-http-client.git
- run: - run:
name: Cloning
command: git clone https://github.com/ipfs/go-ipfs-http-client.git
- restore_cache:
keys:
- v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
- v1-http-client-
- run:
name: go test -v ./...
command: | command: |
export PATH=/tmp/circleci-workspace/bin:$PATH export PATH=/tmp/circleci-workspace/bin:$PATH
go test -v ./... go test -v ./...
working_directory: ~/ipfs/go-ipfs/go-ipfs-http-client working_directory: ~/ipfs/go-ipfs/go-ipfs-http-client
- run: - save_cache:
command: /tmp/circleci-workspace/bin/ipfs shutdown key: v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
paths:
- ~/go/pkg/mod
- ~/.cache/go-build/
workflows: workflows:
version: 2 version: 2
test: test:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论