forked from dolftax/go-rest
/
.travis.yml
54 lines (43 loc) · 1.21 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
language: go
env:
global:
- GO111MODULE=on
- GOREST_MIGRATIONS_FILE_PATH=$TRAVIS_BUILD_DIR/infra/migrations
- GOREST_DEFAULT_DB_HOST=localhost
- GOREST_DEFAULT_DB_PORT=5432
- GOREST_TEST_DB_USER=gopher
- GOREST_TEST_DB_PASSWORD=g0ph3R
- GOREST_TEST_DB_NAME=travis_ci_test
go:
- 1.13.x
services:
- postgresql
# Only clone the most recent commit.
git:
depth: 1
notifications:
email: false
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
before_install:
- go mod download && go mod verify
install: true
before_script:
- psql -c "create database travis_ci_test;" -U postgres
- psql -c "create user gopher with password 'g0ph3R';" -U postgres
- psql -c "grant all privileges on database travis_ci_test to gopher;" -U postgres
script:
- echo $GOREST_MIGRATIONS_FILE_PATH
- echo "DeepSource debug begin."
- echo $TRAVIS_COMMIT
- echo "DS DSN"
- echo $DEEPSOURCE_DSN
- git --no-pager rev-parse HEAD
- echo "Last 5 commits"
- git log -n5
- go test -coverprofile=coverage.out -covermode=atomic -p 1 ./...
after_success:
- curl https://deepsource.io/cli | sh
- ./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out