.gitlab-ci.yml 2.02 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 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"
Tristan Claverie's avatar
Tristan Claverie committed
32
33
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
34
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
35

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

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