image: golang:1.12.5

cache:
  paths:
    - .cache

variables:
  GOPATH: $CI_PROJECT_DIR/.cache

stages:
  - setup
  - validation

setup:
  stage: setup
  script:
    - mkdir -p .cache
    - go get ./...
    - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1

validation:
  stage: validation
  before_script:
    - export PATH="$GOPATH/bin:$PATH"
  script:
    - make ci
