-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
54 lines (54 loc) · 1.44 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
env:
- COVERALLS_PARALLEL=true
language: go
go_import_path: project-root
services:
- mysql
go:
- "1.11"
- "1.12"
- "1.13"
- "1.14"
addons:
apt:
packages:
- libgconf-2-4 # Required for Cypress.
cache:
directories:
- $(npm config get prefix)/lib/node_modules
before_install:
- mysql -e 'SHOW VARIABLES LIKE "%version%";'
- mysql -e 'CREATE DATABASE IF NOT EXISTS main DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'
- export GOPATH=$HOME/gopath/src/project-root
- export PATH=$HOME/gopath/src/project-root/bin:$PATH
- cd $GOPATH/src/app/api
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get github.com/josephspurrier/covfmt
- go get github.com/go-swagger/go-swagger/cmd/swagger
- go get github.com/FiloSottile/gvt
- gvt restore
install:
- cd $GOPATH/src/app/ui
- npm install
- cd $GOPATH/src/app/api
- go install -v ./...
script:
- cd $GOPATH/src/app/ui
- npm run build
- cd $GOPATH/src/app/api
- swagger generate spec -o ./swagger.json
- swagger validate ./swagger.json
- go test ./... -coverprofile cover.out
- cat cover.out | covfmt $GOPATH/src > lcov.info
- go run cmd/api/main.go &
- cd $GOPATH/src/app/ui
- npm install -g wait-on coveralls
- wait-on http://localhost:8080
- npm test
after_success:
- cd $GOPATH/src/app
- cat api/lcov.info | coveralls
notifications:
webhooks: https://coveralls.io/webhook