.gitlab-ci.yml 4.12 KB
Newer Older
1
2
3
image: python:latest

stages:
Arthur Lutz's avatar
Arthur Lutz committed
4
  - qa
5
6
  - lint
  - tests
7
  - after-tests
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
66

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

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

96
py3-from-forge-server:
Laurent Peuch's avatar
Laurent Peuch committed
97
98
  stage: tests
  image: r.intra.logilab.fr/jenkins/jnlp:buster
99
  allow_failure: true
100
101
102
  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
103
  script:
104
    - tox -e py3-from-forge-server
105
106
107
  artifacts:
    paths:
      - /builds/cubicweb/cubicweb/from-forge-server.html
108
      - /builds/cubicweb/cubicweb/py3-from-forge-server-deprecated-warnings.json
109
110
111
112
113

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

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

trigger-readthedocs:
137
138
139
  only:
    refs:
      - branch/default
140
141
142
  except:
    variables:
      - $TRIGGERED_FROM_OTHER_PROJECT
143
144
  stage: after-tests
  script:
145
146
  # 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

sonarqube:
  stage: qa
  image: sonarsource/sonar-scanner-cli
  # WIP
  #only:
  #  - branch/default
  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}