--- 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.7.5 - 1.8 - tip # 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 . # 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 # 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.8 env: STATIC_CHECKERS=1 allow_failures: - go: tip