forked from gregobal/otus-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (66 loc) · 2.14 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
go:
- "1.14"
os:
- linux
git:
depth: 1
quiet: true
submodules: false
notifications:
email: false
env:
global:
- GO111MODULE=on
- GOPROXY=https://proxy.golang.org
- BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
before_install:
- echo "current branch is ${BRANCH}"
- if [ "${BRANCH}" == "master" ]; then travis_terminate 0; fi
- ls ${BRANCH} && cd ${BRANCH}
stages:
- name: Tests
jobs:
include:
- stage: "Tests"
name: "go get"
install: echo "skip"
script: cd /tmp && go get "github.com/${TRAVIS_REPO_SLUG}/${BRANCH}@${BRANCH}"
- stage: "Tests"
name: "Linters"
install: go install github.com/golangci/golangci-lint/cmd/golangci-lint
script: golangci-lint run ./...
if: |
(type = push AND branch != hw12_13_14_15_calendar) OR \
(type = pull_request AND head_branch != hw12_13_14_15_calendar)
- stage: "Tests"
name: "Unit tests"
install: go mod download
script: go test -v -count=1 -race -gcflags=-l -timeout=30s ./...
if: |
(type = push AND branch != hw12_13_14_15_calendar) OR \
(type = pull_request AND head_branch != hw12_13_14_15_calendar)
- stage: "Tests"
name: "Optimization tests"
install: go mod download
script: go test -v -count=1 -timeout=30s -tags bench ./...
if: |
(type = push AND branch == hw10_program_optimization) OR \
(type = pull_request AND head_branch == hw10_program_optimization)
- stage: "Tests"
name: "Bash tests"
install: echo "skip"
script: ./test.sh
if: |
(type = push AND branch IN (hw07_file_copying, hw08_envdir_tool, hw09_generator_of_validators, hw11_telnet_client)) OR \
(type = pull_request AND head_branch IN (hw07_file_copying, hw08_envdir_tool, hw09_generator_of_validators, hw11_telnet_client))
- stage: "Tests"
name: "Makefile"
install: go mod download
script:
- make lint
- make test
- make build
if: |
(type = push AND branch == hw12_13_14_15_calendar) OR \
(type = pull_request AND head_branch == hw12_13_14_15_calendar)