.gitlab-ci.yml 4.21 KB
Newer Older
1
2
3
4
5
image: python:latest

stages:
  - lint
  - tests
6
  - after-tests
7
  - qa
8
9

lint_py:
10
11
12
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
13
14
15
16
17
18
19
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e flake8

lint_manifest:
20
21
22
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
23
24
25
26
27
28
29
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e check-manifest

lint_doc8:
30
31
32
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
33
34
35
36
37
38
39
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e doc8

lint_doc:
40
41
42
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
43
44
45
46
47
48
49
50
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e doc
  allow_failure: true  # XXX fix me

py3_server:
51
52
53
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
54
55
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
56
57
58
  before_script:
    - sudo apt update
    - sudo DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt-get install -y --assume-yes -qq -o=Dpkg::Use-Pty=0 slapd ldap-utils
59
60
  script:
    - tox -e py3-server
61
62
63
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/server.html
64
      - /builds/cubicweb/cubicweb/py3-server-deprecated-warnings.json
65
      - /reports/coverage-server.xml
66
67

py3_web:
68
69
70
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
71
72
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
73
74
  before_script:
    - sudo apt update && sudo apt install -y firefox-esr
75
76
  script:
    - tox -e py3-web
77
78
79
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/web.html
80
      - /builds/cubicweb/cubicweb/py3-web-deprecated-warnings.json
81
      - /reports/coverage-web.xml
82
83

py3_misc:
84
85
86
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
87
88
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
89
90
  before_script:
    - sudo apt update && sudo apt install -y firefox-esr
91
92
  script:
    - tox -e py3-misc
93
94
95
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/misc.html
96
      - /builds/cubicweb/cubicweb/py3-misc-deprecated-warnings.json
97
      - /reports/coverage-misc.xml
Laurent Peuch's avatar
Laurent Peuch committed
98

99
py3-from-forge-server:
Laurent Peuch's avatar
Laurent Peuch committed
100
101
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
102
  allow_failure: true
103
104
105
  before_script:
    - sudo apt update
    - sudo DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt-get install -y --assume-yes -qq -o=Dpkg::Use-Pty=0 slapd ldap-utils
Laurent Peuch's avatar
Laurent Peuch committed
106
  script:
107
    - tox -e py3-from-forge-server
108
109
110
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/from-forge-server.html
111
      - /builds/cubicweb/cubicweb/py3-from-forge-server-deprecated-warnings.json
112
113
114
115
116

py3-from-forge-web:
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
  allow_failure: true
117
118
  before_script:
    - sudo apt update && sudo apt install -y firefox-esr
119
120
  script:
    - tox -e py3-from-forge-web
121
122
123
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/from-forge-web.html
124
      - /builds/cubicweb/cubicweb/py3-from-forge-web-deprecated-warnings.json
125
126
127
128
129

py3-from-forge-misc:
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
  allow_failure: true
130
131
  before_script:
    - sudo apt update && sudo apt install -y firefox-esr
132
133
  script:
    - tox -e py3-from-forge-misc
134
135
136
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/from-forge-misc.html
137
      - /builds/cubicweb/cubicweb/py3-from-forge-misc-deprecated-warnings.json
138
139

trigger-readthedocs:
140
141
142
  only:
    refs:
      - branch/default
143
144
145
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
146
147
  stage: after-tests
  script:
148
149
  # regarding the " everywhere when there is a '%': yaml is extremly weird when % are involved
  - curl -X POST -d "token=${READTHEDOCS_TOKEN}" https://readthedocs.org/api/v2/webhook/cubicweb/33537/ -w "\nhttp code:"\ "%{http_code}\n" -f
Arthur Lutz's avatar
Arthur Lutz committed
150
151
152
153

sonarqube:
  stage: qa
  image: sonarsource/sonar-scanner-cli
154
155
  only:
    - branch/default
Arthur Lutz's avatar
Arthur Lutz committed
156
157
158
159
160
161
162
163
164
165
166
  script:
    - apk add python3 mercurial
    - sonar-scanner
      --define sonar.scm.revision=${CI_COMMIT_REF_NAME##*/}
      --define sonar.projectBaseDir=.
      --define sonar.projectVersion=`python3 ./setup.py --version`
      --define sonar.scm.provider=hg
      --define sonar.projectKey=${CI_PROJECT_PATH_SLUG}
      --define sonar.projectName=${CI_PROJECT_TITLE}
      --define sonar.links.homepage=${CI_PROJECT_URL}
      --define sonar.host.url=${SONAR_URL}