1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-05 12:20:53 +00:00
Beego/.travis.yml

105 lines
4.1 KiB
YAML
Raw Normal View History

2016-01-08 07:34:02 +00:00
language: go
go:
2020-07-19 12:56:58 +00:00
- "1.14.x"
2016-01-08 07:34:02 +00:00
services:
- redis-server
- mysql
- postgresql
- memcached
2020-08-28 17:17:43 +00:00
- docker
2016-01-08 07:34:02 +00:00
env:
global:
- GO_REPO_FULLNAME="github.com/astaxie/beego"
matrix:
- ORM_DRIVER=sqlite3 ORM_SOURCE=$TRAVIS_BUILD_DIR/orm_test.db
- ORM_DRIVER=postgres ORM_SOURCE="user=postgres dbname=orm_test sslmode=disable"
2020-08-26 03:46:22 +00:00
- ORM_DRIVER=mysql export ORM_SOURCE="root:@/orm_test?charset=utf8"
2016-03-08 04:45:54 +00:00
before_install:
2020-08-26 03:46:22 +00:00
# link the local repo with ${GOPATH}/src/<namespace>/<repo>
- GO_REPO_NAMESPACE=${GO_REPO_FULLNAME%/*}
# relies on GOPATH to contain only one directory...
- mkdir -p ${GOPATH}/src/${GO_REPO_NAMESPACE}
- ln -sv ${TRAVIS_BUILD_DIR} ${GOPATH}/src/${GO_REPO_FULLNAME}
- cd ${GOPATH}/src/${GO_REPO_FULLNAME}
# get and build ssdb
- git clone git://github.com/ideawu/ssdb.git
- cd ssdb
- make
- cd ..
2020-08-28 17:17:43 +00:00
# - prepare etcd
2020-08-26 03:46:22 +00:00
# - prepare for etcd unit tests
2020-08-28 17:17:43 +00:00
- rm -rf /tmp/etcd-data.tmp
- mkdir -p /tmp/etcd-data.tmp
- docker rmi gcr.io/etcd-development/etcd:v3.3.25 || true &&
docker run -d
-p 2379:2379
-p 2380:2380
--mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data
--name etcd-gcr-v3.3.25
gcr.io/etcd-development/etcd:v3.3.25
/usr/local/bin/etcd
--name s1
--data-dir /etcd-data
--listen-client-urls http://0.0.0.0:2379
--advertise-client-urls http://0.0.0.0:2379
--listen-peer-urls http://0.0.0.0:2380
--initial-advertise-peer-urls http://0.0.0.0:2380
--initial-cluster s1=http://0.0.0.0:2380
--initial-cluster-token tkn
--initial-cluster-state new
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.float 1.23"
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.bool true"
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.int 11"
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.string hello"
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.serialize.name test"
- docker exec etcd-gcr-v3.3.25 /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put sub.sub.key1 sub.sub.key"
2016-01-08 15:10:50 +00:00
install:
- go get github.com/lib/pq
- go get github.com/go-sql-driver/mysql
- go get github.com/mattn/go-sqlite3
2016-01-08 15:20:25 +00:00
- go get github.com/bradfitz/gomemcache/memcache
- go get github.com/gomodule/redigo/redis
2016-01-08 15:20:25 +00:00
- go get github.com/beego/x2j
2016-03-01 13:41:44 +00:00
- go get github.com/couchbase/go-couchbase
2016-01-08 15:20:25 +00:00
- go get github.com/beego/goyaml2
2018-05-31 11:48:24 +00:00
- go get gopkg.in/yaml.v2
2016-01-08 15:20:25 +00:00
- go get github.com/belogik/goes
2020-06-06 10:59:12 +00:00
- go get github.com/ledisdb/ledisdb
2016-03-07 02:31:56 +00:00
- go get github.com/ssdb/gossdb/ssdb
2016-12-27 01:58:42 +00:00
- go get github.com/cloudflare/golz4
- go get github.com/gogo/protobuf/proto
- go get github.com/Knetic/govaluate
2017-05-19 14:19:31 +00:00
- go get github.com/casbin/casbin
2018-11-06 14:18:48 +00:00
- go get github.com/elazarl/go-bindata-assetfs
2019-01-02 08:46:27 +00:00
- go get github.com/OwnLocal/goes
2019-03-12 04:09:41 +00:00
- go get github.com/shiena/ansicolor
- go get -u honnef.co/go/tools/cmd/staticcheck
2017-03-17 17:45:30 +00:00
- go get -u github.com/mdempsky/unconvert
2017-04-28 13:38:08 +00:00
- go get -u github.com/gordonklaus/ineffassign
2020-06-06 10:59:12 +00:00
- go get -u golang.org/x/lint/golint
2018-07-20 04:14:27 +00:00
- go get -u github.com/go-redis/redis
2016-01-08 07:34:02 +00:00
before_script:
2020-08-28 17:17:43 +00:00
# -
2016-04-11 13:19:10 +00:00
- psql --version
2020-08-26 03:46:22 +00:00
# - prepare for orm unit tests
2016-01-08 15:00:22 +00:00
- sh -c "if [ '$ORM_DRIVER' = 'postgres' ]; then psql -c 'create database orm_test;' -U postgres; fi"
- sh -c "if [ '$ORM_DRIVER' = 'mysql' ]; then mysql -u root -e 'create database orm_test;'; fi"
- sh -c "if [ '$ORM_DRIVER' = 'sqlite' ]; then touch $TRAVIS_BUILD_DIR/orm_test.db; fi"
- sh -c "go get github.com/golang/lint/golint; golint ./...;"
2018-07-30 07:13:04 +00:00
- sh -c "go list ./... | grep -v vendor | xargs go vet -v"
2016-03-08 04:45:54 +00:00
- mkdir -p res/var
- ./ssdb/ssdb-server ./ssdb/ssdb.conf -d
after_script:
2018-11-28 00:59:27 +00:00
- killall -w ssdb-server
2016-03-08 04:45:54 +00:00
- rm -rf ./res/var/*
2016-01-25 13:13:56 +00:00
script:
2020-07-19 12:56:58 +00:00
- go test ./...
2020-08-15 01:39:58 +00:00
- staticcheck -show-ignored -checks "-ST1017,-U1000,-ST1005,-S1034,-S1012,-SA4006,-SA6005,-SA1019,-SA1024" ./pkg
2017-03-17 17:45:30 +00:00
- unconvert $(go list ./... | grep -v /vendor/)
2017-04-28 13:38:08 +00:00
- ineffassign .
- find . ! \( -path './vendor' -prune \) -type f -name '*.go' -print0 | xargs -0 gofmt -l -s
2017-04-30 14:41:23 +00:00
- golint ./...
2016-04-11 15:12:35 +00:00
addons:
2020-08-28 17:17:43 +00:00
postgresql: "9.6"