This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
75 lines (60 loc) · 1.82 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
language: go
sudo: required
go:
- 1.11.x
- stable
- master
matrix:
# Failing on the development version of Go isn't too bad.
allow_failures:
- go: master
env:
global:
- GO111MODULE=on
- REVIEWDOG_REPORTER=github-check
before_install:
# Install golangci-lint
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0
# install reviewdog for github integration of lint results
- mkdir -p ~/bin/ && export PATH="~/bin/:$PATH"
- curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ~/bin
# Override Travis's default 'go get' step, since we use Go modules
install:
- go mod download
before_script:
# Fetch refs for linter
- git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
- git fetch
# Don't record coverage for protobuf/gen & replay/nondefault
- cover_packages=$(go list ./... | grep -v "protobuf/gen\|replay/nondefault" | awk -vORS=',' '{ print $1 }' | sed 's/,$/\n/')
script:
# Lint changed code
- scripts/lint-changes.sh
# Download test data
- pushd test/cs-demos && git lfs pull -I '*' && popd
# Run tests
- go test -coverprofile=coverage.txt -covermode=count -coverpkg=$cover_packages ./...
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_GO_VERSION =~ ^1\.11
- provider: releases
api_key: $GITHUB_TOKEN
file:
- test/results/example.json
- test/results/example.mp
- test/results/example.pb
skip_cleanup: true
on:
tags: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/b0a4814dca40d4a21a37
on_success: change
on_failure: always