.gitlab-ci.yml 2.38 KB
Newer Older
1
2
3
before_script:
  - go version

Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
4
5
6
stages:
  - test

Loïck Bonniot's avatar
Loïck Bonniot committed
7
Unit tests:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
8
9
10
11
12
13
14
  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
15
    - "lesterpig/postfix:latest"
Loïck Bonniot's avatar
Loïck Bonniot committed
16
17
18
  artifacts:
    paths:
      - "coverage.html"
Loïck Bonniot's avatar
Loïck Bonniot committed
19
  script:
20
    - "ln -s $(pwd) $GOPATH/src/dfss"
Richer Maximilien's avatar
Richer Maximilien committed
21
    - "./build/deps.sh"
22
    - "cd $GOPATH/src/dfss && go install ./..."
23
24
25
    - "go test -coverprofile auth.part -v dfss/auth"
    - "go test -coverprofile mgdb.part -v dfss/mgdb"
    - "go test -coverprofile mails.part -v dfss/mails"
Loïck Bonniot's avatar
Loïck Bonniot committed
26
    - "go test -coverprofile net.part -v dfss/net"
27
    - "go test -coverprofile dfssp_authority.part -v dfss/dfssp/authority"
28
29
    - "go test -coverprofile dfssp_user.part -v dfss/dfssp/user"
    - "go test -coverprofile dfssp_contract.part -v dfss/dfssp/contract"
30
    - "go test -coverprofile dfssp_templates.part -v dfss/dfssp/templates"
31
    - "go test -coverprofile dfssd.part -v dfss/dfssd"
32
33
34
    - "go test -coverprofile dfssc_common.part -v dfss/dfssc/common"
    - "go test -coverprofile dfssc_security.part -v dfss/dfssc/security"
    - "go test -coverprofile dfssc_user.part -v dfss/dfssc/user"
Tristan Claverie's avatar
Tristan Claverie committed
35
36
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
37
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
38

Loïck Bonniot's avatar
Loïck Bonniot committed
39
40
41
42
43
ARM tests:
  stage: test
  tags:
    - arm
  script:
Loïck Bonniot's avatar
Loïck Bonniot committed
44
    - "ln -s -f $(pwd) $GOPATH/src/dfss"
Richer Maximilien's avatar
Richer Maximilien committed
45
    - "./build/deps.sh"
46
    - "cd $GOPATH/src/dfss && go install ./..."
Loïck Bonniot's avatar
Loïck Bonniot committed
47
48
    - "go test -cover -short -v dfss/auth"
    - "go test -cover -short -v dfss/mgdb"
Loïck Bonniot's avatar
Loïck Bonniot committed
49
    - "go test -cover -short -v dfss/net"
Loïck Bonniot's avatar
Loïck Bonniot committed
50
    - "go test -cover -short -v dfss/dfssp/authority"
51
52
    - "go test -cover -short -v dfss/dfssp/user"
    - "go test -cover -short -v dfss/dfssp/contract"
53
    - "go test -cover -short -v dfss/dfssp/templates"
54
    - "go test -cover -short -v dfss/dfssd"
55
56
57
    - "go test -cover -short -v dfss/dfssc/common"
    - "go test -cover -short -v dfss/dfssc/security"
    - "go test -cover -short -v dfss/dfssc/user"
Loïck Bonniot's avatar
Loïck Bonniot committed
58

Loïck Bonniot's avatar
Loïck Bonniot committed
59
Code lint:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
60
61
62
63
64
65
  stage: test
  allow_failure: True
  tags:
    - golang
    - lint
  script:
66
    - "ln -s $(pwd) $GOPATH/src/dfss"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
67
    - "go get github.com/alecthomas/gometalinter"
Richer Maximilien's avatar
Richer Maximilien committed
68
    - "./build/deps.sh"
Loïck Bonniot's avatar
Loïck Bonniot committed
69
    - "cd $GOPATH/src/dfss && go install ./..."
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
70
    - "gometalinter --install"
71
    - "gometalinter -t --deadline=600s -j1 --skip=api --skip=fixtures ./..."