mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
28 lines
846 B
Bash
Executable File
28 lines
846 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -xe
|
|
|
|
# Statically checking Go source for errors and warnings.
|
|
gometalinter.v2 --disable-all -E vet -E gofmt -E misspell -E ineffassign -E goimports -E deadcode -E gocyclo --vendor ./...;
|
|
|
|
# Running tests according to current Gotenberg version.
|
|
if [[ "$VERSION" == "snapshot" ]]; then
|
|
for d in $(go list ./... | grep -v vendor); do
|
|
go test -race -cover $d;
|
|
done
|
|
else
|
|
echo "" > ./.ci/coverage.txt;
|
|
for d in $(go list ./... | grep -v vendor); do
|
|
go test -race -coverprofile=profile.out -covermode=atomic $d;
|
|
if [ -f profile.out ]; then
|
|
cat profile.out >> ./.ci/coverage.txt;
|
|
rm profile.out;
|
|
fi
|
|
done
|
|
fi
|
|
|
|
# Builds the Linux binary.
|
|
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION}" && mv gotenberg .ci/;
|
|
|
|
# Bye!
|
|
exit 0; |