2021-01-28 08:11:58 +00:00
|
|
|
image: "nixos/latest"
|
|
|
|
packages:
|
|
|
|
- nixos.go
|
|
|
|
- nixos.git
|
|
|
|
- nixos.gcc
|
|
|
|
sources:
|
|
|
|
- https://github.com/diamondburned/arikawa
|
|
|
|
secrets:
|
|
|
|
# Integration test secrets.
|
|
|
|
- f51d6157-b4be-4697-99d0-6cd129243f63
|
|
|
|
environment:
|
|
|
|
GO111MODULE: "on"
|
|
|
|
CGO_ENABLED: "1"
|
|
|
|
# Integration test variables.
|
2021-09-28 20:19:04 +00:00
|
|
|
SHARD_COUNT: "2"
|
2021-01-28 08:11:58 +00:00
|
|
|
tested: "./api,./gateway,./bot,./discord"
|
|
|
|
cov_file: "/tmp/cov_results"
|
|
|
|
dismock: "github.com/mavolin/dismock/v2/pkg/dismock"
|
|
|
|
dismock_v: "259685b84e4b6ab364b0fd858aac2aa2dfa42502"
|
|
|
|
|
|
|
|
tasks:
|
2021-09-28 20:19:04 +00:00
|
|
|
- generate: |-
|
|
|
|
cd arikawa
|
|
|
|
go generate ./...
|
|
|
|
|
|
|
|
if [[ "$(git status --porcelain)" ]]; then
|
|
|
|
echo "Repository differ after regeneration."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-11-10 00:02:27 +00:00
|
|
|
- build: cd arikawa && go build ./...
|
2021-01-28 08:11:58 +00:00
|
|
|
- unit: cd arikawa && go test -tags unitonly -race ./...
|
2021-09-28 20:19:04 +00:00
|
|
|
|
2021-01-28 08:11:58 +00:00
|
|
|
- integration: |-
|
|
|
|
sh -c '
|
2021-01-28 21:41:43 +00:00
|
|
|
test -f ~/.env || {
|
|
|
|
echo "Skipped integration tests."
|
|
|
|
exit 0
|
|
|
|
}
|
2021-01-28 08:11:58 +00:00
|
|
|
|
|
|
|
cd arikawa
|
|
|
|
go get ./...
|
|
|
|
go get $dismock@$dismock_v
|
|
|
|
|
|
|
|
source ~/.env
|
|
|
|
go test -coverpkg $tested -coverprofile $cov_file -race ./... $dismock
|
|
|
|
go tool cover -func $cov_file
|
|
|
|
'
|