gitlab.com/ignitionrobotics/web/ign-go@v1.0.0-rc4/.gitlab-ci.yml (about)

     1  image: golang:1.13.5
     2  
     3  variables:
     4    PKG_NAME: gitlab.com/ignitionrobotics/web/ign-go.git
     5    MYSQL_DATABASE: "root"
     6    MYSQL_ROOT_PASSWORD: "root"
     7  
     8  before_script:
     9    - go version
    10    - mkdir -p -v $GOPATH/src/$PKG_NAME
    11    - mv -f * $GOPATH/src/$PKG_NAME
    12    - cd $GOPATH/src/$PKG_NAME
    13    - go get
    14  
    15  cache:
    16    key: ${CI_COMMIT_REF_SLUG}
    17    paths:
    18      - /go/pkg/*
    19  
    20  stages:
    21    - formatting
    22    - linting
    23    - testing
    24    - building
    25  
    26  format:
    27    stage: formatting
    28    script:
    29      - go fmt $(go list ./... | grep -v /vendor/)
    30  
    31  lint:
    32    stage: linting
    33    before_script:
    34      - mkdir -p $GOPATH/src/golang.org/x
    35      - git clone https://github.com/golang/lint.git $GOPATH/src/golang.org/x/lint
    36      - go get -u golang.org/x/lint/golint
    37    script:
    38      - golint -set_exit_status $(go list ./... | grep -v /vendor/)
    39  
    40  vet:
    41    stage: testing
    42    script:
    43      - go vet $(go list ./... | grep -v /vendor/)
    44    services:
    45      - mysql:5.7
    46  
    47  test:
    48    stage: testing
    49    script:
    50      - go test $(go list ./... | grep -v /vendor/)
    51    services:
    52      - mysql:5.7
    53  
    54  race:
    55    stage: testing
    56    script:
    57      - go test -race $(go list ./... | grep -v /vendor/)
    58    services:
    59      - mysql:5.7
    60  
    61  coverage:
    62    stage: testing
    63    script:
    64      - go test -covermode=atomic -coverprofile=coverage.tx
    65      - go tool cover -func=coverage.tx
    66      - bash <(curl -s https://codecov.io/bash)
    67    services:
    68      - mysql:5.7
    69  
    70  build:
    71    stage: building
    72    script:
    73      - go build