image: golang:alpine

stages:
  - build

compile:
  stage: build
  script:
    - source ./env
    - go build -tags "$TAGS" -ldflags "$LDFLAGS" ./cmd/hepto.go
  artifacts:
    paths:
      - hepto
    expire_in: 1 week
  variables:
    GOPATH: $CI_PROJECT_DIR/.go
  before_script:
    - git fetch --tags
    - apk add --no-cache git gcc g++ libseccomp-dev libseccomp-static
    - mkdir -p .go
  cache:
    paths:
      - .go/pkg/mod/