.gitlab-ci.yml 1.12 KB
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
Quentin DAUCHY's avatar
Quentin DAUCHY committed
12
    - "lesterpig/postfix:latest"
Loïck Bonniot's avatar
Loïck Bonniot committed
13
14
15
16
  #artifacts: # Waiting GitLab 8.2.1...
  #  paths:
  #    - "coverage.html"
  script:
Tristan Claverie's avatar
Tristan Claverie committed
17
18
19
    - "go get gopkg.in/mgo.v2"
    - "go test -coverprofile auth.part -v ./auth"
    - "go test -coverprofile mgdb.part -v ./mgdb"
Quentin DAUCHY's avatar
Quentin DAUCHY committed
20
    - "go test -coverprofile mails.part -v ./mails"
Tristan Claverie's avatar
Tristan Claverie committed
21
22
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
23
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
24

Loïck Bonniot's avatar
Loïck Bonniot committed
25
26
27
28
29
ARM tests:
  stage: test
  tags:
    - arm
  script:
Tristan Claverie's avatar
Tristan Claverie committed
30
    - "go get gopkg.in/mgo.v2"
Quentin DAUCHY's avatar
Quentin DAUCHY committed
31
32
    - "go test -cover -short -v ./auth"
    - "go test -cover -short -v ./mgdb"
Loïck Bonniot's avatar
Loïck Bonniot committed
33

Loïck Bonniot's avatar
Loïck Bonniot committed
34
Code lint:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
35
36
37
38
39
40
  stage: test
  allow_failure: True
  tags:
    - golang
    - lint
  script:
41
    - "go install ."
Loïck Bonniot's avatar
Loïck Bonniot committed
42
    - "go install ./..."
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
43
    - "go get github.com/alecthomas/gometalinter"
Tristan Claverie's avatar
Tristan Claverie committed
44
    - "go get gopkg.in/mgo.v2"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
45
    - "gometalinter --install"
Quentin DAUCHY's avatar
Quentin DAUCHY committed
46
    - "gometalinter -t --deadline=100s -j1 ./..."