-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
54 lines (44 loc) · 1.52 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
language: go
branches:
only:
- master
- develop
- /^feature.*$/
- /^release.*$/
- /^hostfix.*$/
- /^bugfix.*$/
os:
- linux
- osx
go:
- "1.14"
env:
- APP_NAME=mylabs-go
- GO111MODULE=on
install:
- curl https://cdn.shiftleft.io/download/sl > sl && sudo mv sl /usr/local/bin/ && sudo chmod a+rx /usr/local/bin/sl
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin latest
- sl auth --org $SHIFTLEFT_ORG_ID --token $SHIFTLEFT_ACCESS_TOKEN --no-diagnostic
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install gitversion ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then curl -sSfL https://github.com/GitTools/GitVersion/releases/download/5.3.7/gitversion-ubuntu.16.04-x64-5.3.7.tar.gz | tar zxf - && sudo mv gitversion /usr/local/bin/ && sudo chmod a+x /usr/local/bin/gitversion ; fi
stages:
- Build
- Test
jobs:
include:
- stage: Build
script:
- make build APP_NAME=$APP_NAME GIT_BRANCH_NAME=$(gitversion /showvariable SemBranchName) APP_VERSION=$(gitversion /showvariable SemVer)
- stage: Test
name: Code Quality Tests
script:
- golangci-lint run
- stage: Test
name: Unit Tests
script:
- make test
- stage: test
name: Vulnerabilty Analysis
script:
- sl analyze --wait --tag branch=$TRAVIS_BRANCH --tag app.group=MyLabs --tag app.language=go --app MyLabs-G0 --cpg --go ./...