1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-06 15:04:22 +00:00
arikawa/.gitlab-ci.yml

33 lines
639 B
YAML
Raw Normal View History

2020-01-16 04:43:42 +00:00
image: golang:alpine
variables:
GO111MODULE: "on"
2020-01-20 19:50:21 +00:00
CGO_ENABLED: "0"
2020-01-31 17:32:51 +00:00
COV: "/tmp/cov_results"
2020-01-16 04:43:42 +00:00
before_script:
- apk add git
stages:
- test
unit_test:
stage: test
script:
2020-01-31 17:32:51 +00:00
- go test -tags unit -v -coverprofile $COV ./...
- go tool cover -func $COV
| grep -F 'total:'
| sed -E 's|total:\s+\(.*?\)\s+([0-9]+\.[0-9]+%)|TEST_COVERAGE=\1|'
2020-01-16 04:43:42 +00:00
integration_test:
stage: test
only:
variables:
2020-01-16 04:49:21 +00:00
- $BOT_TOKEN
2020-01-16 04:43:42 +00:00
script:
2020-01-20 19:37:39 +00:00
# go get first, so it doesn't count towards the timeout.
2020-01-20 19:50:21 +00:00
- go get ./...
2020-01-20 11:15:41 +00:00
# Timeout test after 120 seconds (2 minutes)
- timeout 120 go test -tags integration -v ./...
2020-01-16 04:43:42 +00:00