This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
107 lines (87 loc) · 3.55 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
language: go
#dist: trusty
#sudo: false
os:
- linux
services:
- mongodb
- mysql
addons:
apt:
sources:
- mongodb-3.2-precise
packages:
- mongodb-org-server
- pandoc
apt_packages:
- pandoc
go:
- 1.6.3
- 1.7.4
- tip
matrix:
allow_failures:
- go: tip
#branches:
# only:
# - master
# - develop
# - /^v*.*.*$/
env:
global:
- GO_BUILD_LDFLAGS="-s -w -X 'main.version=$TRAVIS_TAG' -X 'main.build=$(git rev-parse --short HEAD)' -X 'main.buildDate=$(date --rfc-3339=seconds)'"
notifications:
email:
on_success: change
on_failure: always
before_install:
- mysql -e "create database IF NOT EXISTS test;" -uroot
install:
- go get -t ./...
- go get -u github.com/stretchr/testify/assert
- go get -u github.com/golang/lint/golint
- go get -u golang.org/x/tools/cmd/goimports
- go get -u golang.org/x/tools/cmd/cover
- go get -u github.com/mattn/goveralls
- go get -u github.com/erikstmartin/go-testdb
before_script:
script:
- go vet ./...
- diff <(goimports -d .) <(printf "")
- diff <(golint ./...) <(printf "")
- go test -v -covermode=count -coverprofile=coverage.out
- goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
#- go test -v -cpu=2 -short ./...
#- go test -v -cpu=1,2,4 -short ./...
after_script:
after_success:
after_failure:
before_deploy:
- pandoc README.md -f markdown -t html -s -o README.html
- cp config.smpl.yml config.yml
- mkdir release
- export GOARCH=386 && export GOOS=linux && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo && chmod +x alsgo && tar -zcvf release/als-go-linux-i386_g$TRAVIS_GO_VERSION.tar.gz alsgo README.html config.yml
- export GOARCH=amd64 && export GOOS=linux && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo && chmod +x alsgo && tar -zcvf release/als-go-linux-amd64_g$TRAVIS_GO_VERSION.tar.gz alsgo README.html config.yml
- export GOARCH=arm && export GOOS=linux && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo && chmod +x alsgo && tar -zcvf release/als-go-linux-arm_g$TRAVIS_GO_VERSION.tar.gz alsgo README.html config.yml
- export GOARCH=arm64 && export GOOS=linux && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo && chmod +x alsgo && tar -zcvf release/als-go-linux-arm64_g$TRAVIS_GO_VERSION.tar.gz alsgo README.html config.yml
- export GOARCH=amd64 && export GOOS=darwin && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo && chmod +x alsgo && tar -zcvf release/als-go-darwin-amd64_g$TRAVIS_GO_VERSION.zip alsgo README.html config.yml
- export GOARCH=amd64 && export GOOS=windows && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo.exe && zip release/als-go-windows-amd64_g$TRAVIS_GO_VERSION.zip alsgo.exe README.html config.yml
- export GOARCH=386 && export GOOS=windows && go env && go build --ldflags "$GO_BUILD_LDFLAGS" -o alsgo.exe && zip release/als-go-windows-386_g$TRAVIS_GO_VERSION.zip alsgo.exe README.html config.yml
deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_OAUTH_TOKEN
file:
- "release/als-go-linux-i386_g$TRAVIS_GO_VERSION.tar.gz"
- "release/als-go-linux-amd64_g$TRAVIS_GO_VERSION.tar.gz"
- "release/als-go-linux-arm_g$TRAVIS_GO_VERSION.tar.gz"
- "release/als-go-linux-arm64_g$TRAVIS_GO_VERSION.tar.gz"
- "release/als-go-darwin-amd64_g$TRAVIS_GO_VERSION.zip"
- "release/als-go-windows-amd64_g$TRAVIS_GO_VERSION.zip"
- "release/als-go-windows-386_g$TRAVIS_GO_VERSION.zip"
on:
repo: riftbit/ALS-Go
tags: true
#go: 1.7.3
all_branches: true
after_deploy: