我无法为Go应用设置ci。它使用dredd进行测试,我使用以下命令启动
dredd api-description.apib http://127.0.0.1:3000
为了使其正常工作,我必须在后台运行go应用。我的问题是让它在circleci上起作用。
目前我在config.yml
version: 2
jobs:
build:
docker:
# specify the version
- image: circleci/golang:1.9
working_directory: /go/src/github.com/me/my-project
steps:
- checkout
#Install node and npm
- run: curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
- run: sudo apt -y install nodejs npm
# Setup dredd
- run: sudo npm install dredd@x.x.x --global
- run: go run main.go //<---- gets stuck here
- run: dredd api-description.apib http://127.0.0.1:3000
但是go应用程序可以运行并有效阻止最终命令,因此测试永远不会运行,并且构建会无限期进行。