You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
e456f88f0f | 9 years ago | |
---|---|---|
.drone.yml | 9 years ago | |
.gitignore | 9 years ago | |
README.md | 9 years ago | |
main.go | 9 years ago | |
main_test.go | 9 years ago |
README.md
drone-with-go
An example of how to test Go code.
Basic Testing
To run basic CI tests use the following in your .drone.yml
file.
build:
image: golang:1.5.3
commands:
- go test ./...
Advanced Testing
Using environment variables to configure Go testing is easy.
Configure environment variables by setting the build
section's environment
.
.drone.yml
:
build:
image: golang:1.5.3
environment:
- GO15VENDOREXPERIMENT=1
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
commands:
- go test ./...
Below is a more advanced .drone.yml
for notification integrations like HipChat.
build:
image: golang:1.5.3
environment:
- GO15VENDOREXPERIMENT=1
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
- COVERALLS_TOKEN=$$COVERALLS_TOKEN
commands:
- go test -cover ./...
notify:
hipchat:
from: Your_Project
notify: true
room_id_or_name: Your_Room
auth_token: $$HIPCHAT_DRONE_TOKEN