-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
135 lines (127 loc) · 3.96 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
# DO NOT EDIT THIS FILE DIRECTLY
#
# It is automatically copied from https://github.com/pion/.goassets repository.
# If this repository should have package specific CI config,
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
#
dist: bionic
language: go
branches:
only:
- master
env:
global:
- GO111MODULE=on
- GOLANGCI_LINT_VERSION=1.19.1
cache:
directories:
- ${HOME}/.cache/go-build
- ${GOPATH}/pkg/mod
npm: true
yarn: true
_lint_job: &lint_job
env: CACHE_NAME=lint
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
install: skip
before_script:
- |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| bash -s - -b $GOPATH/bin v${GOLANGCI_LINT_VERSION}
script:
- bash .github/assert-contributors.sh
- bash .github/lint-disallowed-functions-in-library.sh
- bash .github/lint-commit-message.sh
- bash .github/lint-filename.sh
- golangci-lint run ./...
_test_job: &test_job
env: CACHE_NAME=test
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
- go mod download
install:
- go build ./...
script:
- testpkgs=${TEST_PACKAGES:-$(go list ./... | grep -v examples)}
- coverpkgs=$(echo "${testpkgs}" | paste -s -d ',')
- |
go test \
-coverpkg=${coverpkgs} -coverprofile=cover.out -covermode=atomic \
${TEST_EXTRA_ARGS:-} \
-v -race ${testpkgs}
- if [ -n "${TEST_HOOK}" ]; then ${TEST_HOOK}; fi
after_success:
- travis_retry bash <(curl -s https://codecov.io/bash) -c -F go
_test_i386_job: &test_i386_job
env: CACHE_NAME=test386
services: docker
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
script:
- testpkgs=${TEST_PACKAGES:-$(go list ./... | grep -v examples)}
- |
docker run \
-u $(id -u):$(id -g) \
-e "GO111MODULE=on" \
-e "CGO_ENABLED=0" \
-v ${PWD}:/go/src/github.com/pion/$(basename ${PWD}) \
-v ${HOME}/gopath/pkg/mod:/go/pkg/mod \
-v ${HOME}/.cache/go-build:/.cache/go-build \
-w /go/src/github.com/pion/$(basename ${PWD}) \
-it i386/golang:${GO_VERSION}-alpine \
/usr/local/go/bin/go test \
${TEST_EXTRA_ARGS:-} \
-v ${testpkgs}
_test_wasm_job: &test_wasm_job
env: CACHE_NAME=wasm
language: node_js
node_js: 12
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
- if ${SKIP_WASM_TEST:-false}; then exit 0; fi
install:
# Manually download and install Go instead of using gimme.
# It looks like gimme Go causes some errors on go-test for Wasm.
- curl -sSfL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -C ~ -xzf -
- export GOROOT=${HOME}/go
- export PATH=${GOROOT}/bin:${PATH}
- yarn install
- export GO_JS_WASM_EXEC=${GO_JS_WASM_EXEC:-${GOROOT}/misc/wasm/go_js_wasm_exec}
script:
- testpkgs=${TEST_PACKAGES:-$(go list ./... | grep -v examples)}
- coverpkgs=$(echo "${testpkgs}" | paste -s -d ',')
- |
GOOS=js GOARCH=wasm go test \
-coverpkg=${coverpkgs} -coverprofile=cover.out -covermode=atomic \
-exec="${GO_JS_WASM_EXEC}" \
-v ${testpkgs}
after_success:
- travis_retry bash <(curl -s https://codecov.io/bash) -c -F wasm
jobs:
include:
- <<: *lint_job
name: Lint 1.14
go: 1.14
- <<: *test_job
name: Test 1.13
go: 1.13
- <<: *test_job
name: Test 1.14
go: 1.14
- <<: *test_i386_job
name: Test i386 1.13
env: GO_VERSION=1.13
go: 1.14 # version for host environment used to go list
- <<: *test_i386_job
name: Test i386 1.14
env: GO_VERSION=1.14
go: 1.14 # version for host environment used to go list
- <<: *test_wasm_job
name: Test WASM 1.13
env: GO_VERSION=1.13
- <<: *test_wasm_job
name: Test WASM 1.14
env: GO_VERSION=1.14
notifications:
email: false