forked from exercism/go
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
71 lines (65 loc) · 2.79 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
---
language: go
sudo: false
# We expect users to use something fairly recent so we test the last two
# versions plus tip. Update these freely as new versions of Go are released.
#
# We choose two versions since official support of Go mirrors this policy:
# Only the current major release (x.y) has full official support.
# The previous major release gets security-only support.
#
# Tip is useful to automatically test a version more recent than the
# the last time .travis.yml was looked at, and (unlikely as it might be)
# to alert us to any real upcoming change in the language that would be
# incompatible with our existing code.
#
# We used to test additional versions beyond the last two,
# but since Travis only runs five jobs at a time throughout all of Exercism,
# it is better citizenship to not test the additional versions.
go:
- 1.11.x
- 1.12.x
- master
# Travis runs in a 64 bit environment but beginning with Go 1.5, building a
# 32 bit target is as easy as specifying GOARCH. We test both to accommodate
# users that might be running 32 bit environments and make sure our code
# works for them.
#
# Race detection is valuable for our problems that involve concurrency.
# The race detector isn't supported on 386 though.
env:
- TESTARCH=amd64 RACE=-race
- TESTARCH=386
# Travis doc for the install step says it is for any dependencies of the
# build. We don't have any build dependencies so we can disable this with
# `install: true`. (Actually we have to specify either true or something else
# here because the default step for this is currently `go get -t ./...` which
# doesn't work for us because some of our stub files have invalid Go syntax
# or duplicate definitions of the example files)
install: true
# Configlet tests a number of things like config.json.
# See https://github.com/exercism/configlet.
before_script:
- bin/fetch-configlet
- bin/configlet lint .
- bin/fetch-golangci-lint v1.16.0
# Our "build" is to run `go test` which is what our users do.
# -cpu 2 is for our problems that involve concurrency to test that they
# perform as expected on multiple cores.
script:
- if [ -n "$STATIC_CHECKERS" ]; then ./bin/test-without-stubs fmt; fi
- if [ -n "$STATIC_CHECKERS" ]; then ./bin/test-without-stubs vet; fi
- if [ -z "$STATIC_CHECKERS" ]; then ./bin/test-without-stubs; fi
- if [ -n "$STATIC_CHECKERS" ]; then
./bin/test-without-stubs lint '--disable=errcheck,megacheck --enable=goimports,goconst,gocyclo';
fi
# special cases for the build matrix are STATIC_CHECKERS gets its own entry
# and that tip is allowed to fail. Broken tips are extremely rare these days
# but anyway, it could happen and it wouldn't be our problem.
matrix:
include:
# Keep this in sync with the latest version.
- go: 1.12.x
env: STATIC_CHECKERS=1
allow_failures:
- go: tip