.gitlab-ci.yml 1.14 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
  artifacts:
    paths:
      - "coverage.html"
Loïck Bonniot's avatar
Loïck Bonniot committed
16
  script:
17
    - "ln -s $(pwd) $GOPATH/src/dfss"
Tristan Claverie's avatar
Tristan Claverie committed
18
19
20
    - "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
21
    - "go test -coverprofile mails.part -v ./mails"
Tristan Claverie's avatar
Tristan Claverie committed
22
23
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
24
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
25

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

Loïck Bonniot's avatar
Loïck Bonniot committed
35
Code lint:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
36
37
38
39
40
41
  stage: test
  allow_failure: True
  tags:
    - golang
    - lint
  script:
42
    - "ln -s $(pwd) $GOPATH/src/dfss"
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"
45
    - "go install ./..."
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
46
    - "gometalinter --install"
Quentin DAUCHY's avatar
Quentin DAUCHY committed
47
    - "gometalinter -t --deadline=100s -j1 ./..."