.gitlab-ci.yml 1.35 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
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"
    - "go test -coverprofile authority.part -v dfss/dfssp/authority"
Tristan Claverie's avatar
Tristan Claverie committed
26
27
    - "echo 'mode: set' *part > c.out"
    - "grep -h -v 'mode: set' *part >> c.out"
Loïck Bonniot's avatar
Loïck Bonniot committed
28
    - "go tool cover -html=c.out -o coverage.html"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
29

Loïck Bonniot's avatar
Loïck Bonniot committed
30
31
32
33
34
ARM tests:
  stage: test
  tags:
    - arm
  script:
Loïck Bonniot's avatar
Loïck Bonniot committed
35
    - "ln -s -f $(pwd) $GOPATH/src/dfss"
Richer Maximilien's avatar
Richer Maximilien committed
36
    - "./build/deps.sh"
Loïck Bonniot's avatar
Loïck Bonniot committed
37
38
39
    - "go test -cover -short -v dfss/auth"
    - "go test -cover -short -v dfss/mgdb"
    - "go test -cover -short -v dfss/dfssp/authority"
Loïck Bonniot's avatar
Loïck Bonniot committed
40

Loïck Bonniot's avatar
Loïck Bonniot committed
41
Code lint:
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
42
43
44
45
46
47
  stage: test
  allow_failure: True
  tags:
    - golang
    - lint
  script:
48
    - "ln -s $(pwd) $GOPATH/src/dfss"
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
49
    - "go get github.com/alecthomas/gometalinter"
Richer Maximilien's avatar
Richer Maximilien committed
50
    - "./build/deps.sh"
51
    - "go install ./..."
Loïck Bonniot's avatar
Add CI  
Loïck Bonniot committed
52
    - "gometalinter --install"
Loïck Bonniot's avatar
Loïck Bonniot committed
53
    - "gometalinter -t --deadline=300s -j1 --skip=api --skip=fixtures ./..."