forked from pion/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
130 lines (122 loc) · 3.57 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
#
# 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_script:
- |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| bash -s - -b $GOPATH/bin v${GOLANGCI_LINT_VERSION}
install: skip
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:
- go mod download
install:
- go build ./...
script:
- coverpkgs=$(go list ./... | grep -v examples | paste -s -d ',')
- |
go test \
-coverpkg=${coverpkgs} -coverprofile=cover.out -covermode=atomic \
-tags quic \
-v -race ./...
after_success:
- travis_retry bash <(curl -s https://codecov.io/bash) -c -F go
test_i386_job: &test_i386_job
env: CACHE_NAME=test386
language: bash
services: docker
install:
# i386/golang:1.12-alpine doesn't have git.
- echo -e "FROM i386/golang:${GO_VERSION}-alpine\nRUN apk add --no-cache git" > Dockerfile
- docker build -t go-tester .
script:
- |
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 go-tester \
/usr/local/go/bin/go test \
-tags quic \
-v ./...
test_wasm_job: &test_wasm_job
env: CACHE_NAME=wasm
language: node_js
node_js: 12
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=${GOROOT}/misc/wasm/go_js_wasm_exec
# If the repository has wasm_exec hook, use it.
- |
if [ -f test-wasm/go_js_wasm_exec ]; then
export GO_JS_WASM_EXEC=${PWD}/test-wasm/go_js_wasm_exec
fi
script:
- testpkgs=$(go list ./... | grep -v examples)
- coverpkgs=$(go list ./... | grep -v examples | 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.13
go: 1.13
- <<: *test_job
name: Test 1.12
go: 1.12
- <<: *test_job
name: Test 1.13
go: 1.13
- <<: *test_i386_job
name: Test i386 1.12
env: GO_VERSION=1.12
- <<: *test_i386_job
name: Test i386 1.13
env: GO_VERSION=1.13
- <<: *test_wasm_job
name: Test WASM 1.13
# Requires Go1.13 syscall/js
env: GO_VERSION=1.13
notifications:
email: false