mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-11-30 08:08:13 +00:00
CI: haha json go brr
This commit is contained in:
parent
bafeb1082a
commit
f91518f3c6
|
|
@ -1,45 +1,36 @@
|
||||||
image: golang:alpine
|
{
|
||||||
|
"image": "golang:alpine",
|
||||||
variables:
|
"variables": {
|
||||||
GO111MODULE: "on"
|
"GO111MODULE": "on",
|
||||||
CGO_ENABLED: "0"
|
"CGO_ENABLED": "0",
|
||||||
COV: "/tmp/cov_results"
|
"COV": "/tmp/cov_results"
|
||||||
|
},
|
||||||
before_script:
|
"before_script": [
|
||||||
- apk add git
|
"apk add git"
|
||||||
|
],
|
||||||
stages:
|
"stages": [
|
||||||
- test
|
"test"
|
||||||
|
],
|
||||||
build_test:
|
"build_test": {
|
||||||
stage: test
|
"stage": "test",
|
||||||
script:
|
"script": [
|
||||||
- go build ./...
|
"go build ./..."
|
||||||
|
]
|
||||||
unit_test:
|
},
|
||||||
stage: test
|
"unit_test": {
|
||||||
script:
|
"stage": "test",
|
||||||
- go test -v -coverprofile $COV ./...
|
"script": [
|
||||||
- go tool cover -func $COV
|
"go test -v -coverprofile $COV ./...",
|
||||||
|
"go tool cover -func $COV"
|
||||||
integration_test:
|
]
|
||||||
stage: test
|
},
|
||||||
script:
|
"integration_test": {
|
||||||
# Don't run if these variables aren't provided.
|
"stage": "test",
|
||||||
- '[ ! "$BOT_TOKEN" ] && exit'
|
"script": [
|
||||||
# go get first, so it doesn't count towards the timeout.
|
"[ ! \"$BOT_TOKEN\" ] && exit",
|
||||||
- go get ./...
|
"go get ./...",
|
||||||
|
"timeout 120 go test -coverpkg \"./api,./gateway,./bot,./discord\" -coverprofile $COV -tags integration -v ./... github.com/mavolin/dismock/pkg/dismock",
|
||||||
# Timeout test after 120 seconds (2 minutes)
|
"go tool cover -func $COV"
|
||||||
- timeout 120 go test
|
]
|
||||||
# Known packages that are important to do integration tests on.
|
}
|
||||||
-coverpkg "./api,./gateway,./bot,./discord"
|
}
|
||||||
-coverprofile $COV
|
|
||||||
-tags integration
|
|
||||||
-v
|
|
||||||
# Test both the current package and the external API mocking package.
|
|
||||||
./...
|
|
||||||
github.com/mavolin/dismock/pkg/dismock
|
|
||||||
|
|
||||||
- go tool cover -func $COV
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue