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

stages:
4
5
6
  - vet
  - test
  - build
Christian Pointner's avatar
Christian Pointner committed
7

Christian Pointner's avatar
Christian Pointner committed
8
vet:
9
    stage: vet
Christian Pointner's avatar
Christian Pointner committed
10
    script:
Christian Pointner's avatar
Christian Pointner committed
11
      - go vet ./...
Christian Pointner's avatar
Christian Pointner committed
12
13

test:
14
15
16
17
18
    state: test
    script:
      - go test -v -cover $(go list ./... | grep -v tank/store)

test-store-mysql:
Christian Pointner's avatar
Christian Pointner committed
19
    stage: test
20
21
22
23
24
25
26
    services:
      - mysql:5.7
    variables:
      MYSQL_DATABASE: "tank"
      MYSQL_USER: "tank"
      MYSQL_PASSWORD: "aura"
      MYSQL_ROOT_PASSWORD: "yes"
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
      AURA_TANK_TEST_DB_TYPE: "mysql"
      AURA_TANK_TEST_DB_HOST: "mysql"
    script:
      - go test -v -cover ./...

test-store-postgres:
    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"
Christian Pointner's avatar
Christian Pointner committed
42
    script:
43
      - go test -v -cover ./...
Christian Pointner's avatar
Christian Pointner committed
44

Christian Pointner's avatar
Christian Pointner committed
45
build:
Christian Pointner's avatar
Christian Pointner committed
46
    stage: build
Christian Pointner's avatar
Christian Pointner committed
47
    script:
48
      - go build -ldflags "-extldflags '-static'" -tags netgo -o $CI_PROJECT_DIR/tank ./cmd/tank
Christian Pointner's avatar
Christian Pointner committed
49
      ## sqlite needs cgo... :(
50
      ##- go build -o $CI_PROJECT_DIR/tank ./cmd/tank
Christian Pointner's avatar
Christian Pointner committed
51
52
53
    artifacts:
      paths:
        - tank