-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
64 lines (53 loc) · 1.23 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
55
56
57
58
59
60
61
62
63
64
language: go
go:
- "1.19"
os:
- linux
dist: xenial
env:
global:
- GO111MODULE=on
services:
- mysql
- redis
cache:
directories:
- $GOPATH/pkg/mod
# work flow of entire CI lifecycle
#
# before_install
# install
# before_script
# script
# after_success / after_failure
# before_deploy
# deploy
# after_deploy
# after_script
before_install:
# prepare MySQL
- echo "Prepare MySQL"
- mysql -e "CREATE DATABASE hexagonal"
- sudo mysql -e "USE mysql; UPDATE user SET authentication_string=PASSWORD('root') WHERE User='root'; UPDATE user SET plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -proot
- sudo service mysql restart
# Check Go Env
- echo "Check Go Env"
- echo "GOPATH:" $GOPATH
- echo "GOROOT:" $GOROOT
install:
- echo "Go Mod Tidy"
- go mod tidy -v
before_script:
- echo ""
script:
# post script will still execute if pre script failed, replace with `pre-script && post-script` if you need
- echo "Go Test"
- go test ./... -v
notifications:
slack:
rooms:
- ranchocooper:jvc0GfKUQ1znwfsz2JfAEx2R#travis-ci
on_pull_requests: true
on_success: always
on_failure: always