1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-19 21:32:49 +00:00
arikawa/.gitlab-ci.yml

54 lines
1.3 KiB
YAML
Raw Normal View History

2020-05-30 21:45:22 +00:00
{
2021-01-01 07:48:29 +00:00
"image": "golang:alpine",
"variables": {
"GO111MODULE": "on",
"CGO_ENABLED": "1", # for the race detector
"COV": "/tmp/cov_results",
2021-09-24 05:25:08 +00:00
"dismock": "github.com/mavolin/dismock/v3/pkg/dismock",
2021-01-01 07:48:29 +00:00
"dismock_v": "259685b84e4b6ab364b0fd858aac2aa2dfa42502",
# used only in integration_test
"tested": "./api,./gateway,./bot,./discord"
},
"before_script": [
"apk add git build-base"
2021-09-24 05:25:08 +00:00
"go get ./...",
"go get $dismock@$dismock_v",
2021-01-01 07:48:29 +00:00
],
"stages": [
"build",
"test"
],
"build_test": {
"stage": "build",
"script": [
"go build ./..."
]
},
"unit_test": {
"stage": "test",
2021-08-17 02:23:32 +00:00
"timeout": "4m", # 4 minutes
2021-01-01 07:48:29 +00:00
# Don't run the test if we have a $BOT_TOKEN, because
# integration_test will run instead.
"except": {
"variables": [ "$BOT_TOKEN" ]
2020-05-30 21:45:22 +00:00
},
2021-01-01 07:48:29 +00:00
"script": [
2021-09-24 05:25:08 +00:00
"go test -coverpkg $tested -coverprofile $COV -tags unitonly -v -race ./... $dismock",
2021-01-01 07:48:29 +00:00
"go tool cover -func $COV"
]
},
"integration_test": {
"stage": "test",
2021-08-17 02:23:32 +00:00
"timeout": "8m", # 8 minutes
2021-01-01 07:48:29 +00:00
# Run the test only if we have $BOT_TOKEN, else fallback to unit
# tests.
"only": {
"variables": [ "$BOT_TOKEN", "$CHANNEL_ID", "$VOICE_ID" ]
2020-05-30 21:45:22 +00:00
},
2021-01-01 07:48:29 +00:00
"script": [
2021-08-17 02:23:32 +00:00
"go test -coverpkg $tested -coverprofile $COV -v -race ./... $dismock",
2021-01-01 07:48:29 +00:00
"go tool cover -func $COV"
]
}
2020-05-30 21:45:22 +00:00
}