github.com/evanlouie/fabrikate@v0.17.4/azure-pipelines.yml (about)

     1  pool:
     2    vmImage: "Ubuntu-16.04"
     3  
     4  variables:
     5    GOBIN: "$(GOPATH)/bin" # Go binaries path
     6    GOROOT: "/usr/local/go1.13" # Go installation path
     7    GOPATH: "$(system.defaultWorkingDirectory)/gopath" # Go workspace path
     8    modulePath: "$(GOPATH)/src/github.com/$(build.repository.name)" # Path to the module's code
     9    GO111MODULE: "on"
    10  
    11  steps:
    12    - script: |
    13        mkdir -p '$(GOBIN)'
    14        mkdir -p '$(GOPATH)/pkg'
    15        mkdir -p '$(modulePath)'
    16        shopt -s extglob
    17        shopt -s dotglob
    18        mv !(gopath) '$(modulePath)'
    19        echo '##vso[task.prependpath]$(GOBIN)'
    20        echo '##vso[task.prependpath]$(GOROOT)/bin'
    21        go version
    22      displayName: "Set up Go workspace"
    23  
    24    - script: |
    25        HELM_URL=https://storage.googleapis.com/kubernetes-helm
    26        HELM_TGZ=helm-v2.13.1-linux-amd64.tar.gz
    27        wget -q ${HELM_URL}/${HELM_TGZ}
    28        tar xzfv ${HELM_TGZ}
    29        PATH=`pwd`/linux-amd64/:$PATH
    30        helm init --client-only
    31      displayName: "Install helm"
    32  
    33    - script: |
    34        curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0
    35      displayName: Install linter
    36  
    37    - script: |
    38        scripts/build clean
    39        go mod download
    40      workingDirectory: "$(modulePath)"
    41      displayName: "Get Go dependencies"
    42  
    43    - script: |
    44        golangci-lint run
    45      workingDirectory: "$(modulePath)"
    46      displayName: "Lint"
    47  
    48    - script: |
    49        go test -v -race ./...
    50      workingDirectory: "$(modulePath)"
    51      displayName: "Test"