.gitlab-ci.yml 1.03 KB
Newer Older
Christian Pointner's avatar
Christian Pointner committed
1
image: golang:1.12
Christian Pointner's avatar
Christian Pointner committed
2

3
4
5
6
cache:
  paths:
    - /go/

Christian Pointner's avatar
Christian Pointner committed
7
stages:
8
9
10
  - vet
  - test
  - build
Christian Pointner's avatar
Christian Pointner committed
11

12

Christian Pointner's avatar
Christian Pointner committed
13
vet:
14
15
16
17
  stage: vet
  script:
    - go vet ./...

Christian Pointner's avatar
Christian Pointner committed
18
19

test:
20
21
22
  stage: test
  script:
    - go test -v -cover $(go list ./... | grep -v tank/store)
23
24

test-store-mysql:
25
26
27
28
29
30
31
32
33
34
35
36
  stage: test
  services:
    - mysql:5.7
  variables:
    MYSQL_DATABASE: "tank"
    MYSQL_USER: "tank"
    MYSQL_PASSWORD: "aura"
    MYSQL_ROOT_PASSWORD: "yes"
    AURA_TANK_TEST_DB_TYPE: "mysql"
    AURA_TANK_TEST_DB_HOST: "mysql"
  script:
    - go test -v -cover ./store
37
38

test-store-postgres:
39
40
41
42
43
44
45
46
47
48
49
50
  stage: test
  services:
    - postgres:9.6
  variables:
    POSTGRES_DB: "tank"
    POSTGRES_USER: "tank"
    POSTGRES_PASSWORD: "aura"
    AURA_TANK_TEST_DB_TYPE: "postgres"
    AURA_TANK_TEST_DB_HOST: "postgres"
  script:
    - go test -v -cover ./store

Christian Pointner's avatar
Christian Pointner committed
51

Christian Pointner's avatar
Christian Pointner committed
52
build:
53
54
55
56
57
58
59
60
  stage: build
  script:
    - go build -ldflags "-extldflags '-static'" -tags netgo -o $CI_PROJECT_DIR/tank ./cmd/tank
    ## sqlite needs cgo... :(
    ##- go build -o $CI_PROJECT_DIR/tank ./cmd/tank
  artifacts:
    paths:
      - tank