.gitlab-ci.yml 1000 Bytes
Newer Older
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
1
2
3
stages:
  - test

Loïck Bonniot's avatar
Loïck Bonniot committed
4
Unit tests:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
5
6
7
8
9
10
11
  stage: test
  tags:
    - golang
    - mongo  # Require an available mongo service
    - strong # Disable this build on small runners
  services:
    - "lesterpig/mongo:latest" # Use this light version of mongo
Loïck Bonniot's avatar
Loïck Bonniot committed
12
13
14
15
  #artifacts: # Waiting GitLab 8.2.1...
  #  paths:
  #    - "coverage.html"
  script:
Tristan Claverie's avatar
Tristan Claverie committed
16
17
18
19
20
    - "go get gopkg.in/mgo.v2"
    - "go test -coverprofile auth.part -v ./auth"
    - "go test -coverprofile mgdb.part -v ./mgdb"
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
21
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
22

Loïck Bonniot's avatar
Loïck Bonniot committed
23
24
25
26
27
ARM tests:
  stage: test
  tags:
    - arm
  script:
Tristan Claverie's avatar
Tristan Claverie committed
28
29
    - "go get gopkg.in/mgo.v2"
    - "go test -cover -short -run 'Test[^M][^o][^n][^g][^o]' -v ./..."
Loïck Bonniot's avatar
Loïck Bonniot committed
30

Loïck Bonniot's avatar
Loïck Bonniot committed
31
Code lint:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
32
33
34
35
36
37
38
  stage: test
  allow_failure: True
  tags:
    - golang
    - lint
  script:
    - "go get github.com/alecthomas/gometalinter"
Tristan Claverie's avatar
Tristan Claverie committed
39
    - "go get gopkg.in/mgo.v2"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
40
41
    - "gometalinter --install"
    - "gometalinter -t --deadline=60s ./..."