提交 895fe215 作者: Steven Allen

ci: dry up benchmark logic

上级 2aa9e2fb
version: 2.0 version: 2.1
aliases: aliases:
make_out_dirs: &make_out_dirs make_out_dirs: &make_out_dirs
...@@ -17,6 +17,30 @@ aliases: ...@@ -17,6 +17,30 @@ aliases:
- ~/go/pkg/mod - ~/go/pkg/mod
- ~/.cache/go-build/ - ~/.cache/go-build/
commands:
benchmark:
parameters:
output:
type: string
branch:
type: string
default: HEAD
steps:
- checkout
- run: git checkout << parameters.branch >>
- *make_out_dirs
- *restore_gomod
- run:
command: go test -tags nofuse -run=NONE -bench=. ./... | tee /tmp/circleci-workspace/<< parameters.output >>
environment:
IPFS_LOGGING: critical
CGO_ENABLED: 0
- persist_to_workspace:
root: /tmp/circleci-workspace
paths:
- << parameters.output >>
- *store_gomod
defaults: &defaults defaults: &defaults
working_directory: ~/ipfs/go-ipfs working_directory: ~/ipfs/go-ipfs
...@@ -146,57 +170,24 @@ jobs: ...@@ -146,57 +170,24 @@ jobs:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
<<: *defaults <<: *defaults
steps: steps:
- checkout - benchmark:
- run: git checkout release output: benchmark-release.txt
- *make_out_dirs branch: release
- *restore_gomod
- run:
command: go test -tags nofuse -run=NONE -bench=. ./... | tee /tmp/circleci-workspace/benchmark-release.txt
environment:
IPFS_LOGGING: critical
CGO_ENABLED: 0
- persist_to_workspace:
root: /tmp/circleci-workspace
paths:
- benchmark-release.txt
- *store_gomod
benchmark-before: benchmark-before:
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
<<: *defaults <<: *defaults
steps: steps:
- checkout - benchmark:
- run: git checkout master output: benchmark-before.txt
- *make_out_dirs branch: master
- *restore_gomod
- run:
command: go test -tags nofuse -run=NONE -bench=. ./... | tee /tmp/circleci-workspace/benchmark-before.txt
environment:
IPFS_LOGGING: critical
CGO_ENABLED: 0
- persist_to_workspace:
root: /tmp/circleci-workspace
paths:
- benchmark-before.txt
- *store_gomod
benchmark-after: benchmark-after:
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
<<: *defaults <<: *defaults
steps: steps:
- checkout - benchmark:
- *make_out_dirs output: benchmark-after.txt
- *restore_gomod
- run:
command: go test -tags nofuse -run=NONE -bench=. ./... | tee /tmp/circleci-workspace/benchmark-after.txt
environment:
IPFS_LOGGING: critical
CGO_ENABLED: 0
- persist_to_workspace:
root: /tmp/circleci-workspace
paths:
- benchmark-after.txt
- *store_gomod
benchmark-compare: benchmark-compare:
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论