2020-05-31 11:40:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
cd ..
|
|
|
|
set -x
|
|
|
|
|
2020-06-06 00:47:48 +01:00
|
|
|
# Check we can build everything
|
2020-06-01 17:49:30 +01:00
|
|
|
go mod download
|
2020-06-06 00:47:48 +01:00
|
|
|
go build ./...
|
2020-05-31 19:48:43 +01:00
|
|
|
|
2020-06-06 00:47:48 +01:00
|
|
|
# Run the server and shut it down again to ensure our docker-compose works
|
2020-06-06 11:52:12 +01:00
|
|
|
ROVE_ARGS="--quit 1" docker-compose up --build --exit-code-from=rove-server --abort-on-container-exit
|
2020-05-31 11:55:46 +01:00
|
|
|
|
2020-06-06 00:47:48 +01:00
|
|
|
# Run tests with coverage
|
2020-06-06 12:13:54 +01:00
|
|
|
go test -v ./... -cover -coverprofile=/tmp/c.out -count 1
|
2020-06-06 00:47:48 +01:00
|
|
|
|
2020-05-31 11:55:46 +01:00
|
|
|
# Convert the coverage data to html
|
|
|
|
go tool cover -html=/tmp/c.out -o /tmp/coverage.html
|