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

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

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

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

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

lint_doc:
41
42
43
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
44
45
46
47
48
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e doc
49
50
51
52
  artifacts:
    paths:
      - .tox/doc/tmp/html
  allow_failure: true # XXX fix me
53
54

py3_server:
55
56
57
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
58
59
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
60
61
62
  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
63
64
  script:
    - tox -e py3-server
65
66
67
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/server.html
68
      - /builds/cubicweb/cubicweb/py3-server-deprecated-warnings.json
69
      - /reports/coverage-server.xml
70
71

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

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

103
py3-from-forge-server:
Laurent Peuch's avatar
Laurent Peuch committed
104
105
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
106
  allow_failure: true
107
108
109
  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
110
  script:
111
    - tox -e py3-from-forge-server
112
113
114
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/from-forge-server.html
115
      - /builds/cubicweb/cubicweb/py3-from-forge-server-deprecated-warnings.json
116
117
118
119
120

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

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

trigger-readthedocs:
144
145
146
  only:
    refs:
      - branch/default
147
148
149
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
150
151
  stage: after-tests
  script:
152
153
  # 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
154
155
156
157

sonarqube:
  stage: qa
  image: sonarsource/sonar-scanner-cli
158
159
  only:
    - branch/default
Arthur Lutz's avatar
Arthur Lutz committed
160
161
162
163
164
165
166
167
168
169
170
  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}
171
172
173
174
175
176
177
178
179
180
181
182
183

pages:
  stage: deploy
  before_script:
    - pip install tox
  script:
    - tox -e doc
    - mv .tox/doc/tmp/html public
  artifacts:
    paths:
      - public
  only:
    - branch/default