.gitlab-ci.yml 1.7 KB
Newer Older
Fabien Amarger's avatar
Fabien Amarger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
default:
  image: python

# avoid running duplicate pipelines for both topic head and MR
# see: https://docs.gitlab.com/ee/ci/yaml/#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_REF_NAME =~ /^topic\/.*/  && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - when: always

stages:
  - lint
  - tests
  - after-tests

before_script:
  - pip install tox

flake8:
  stage: lint
  script: tox -e flake8

check-manifest:
  stage: lint
  script: tox -e check-manifest

black:
  stage: lint
  script: tox -e black

yamllint:
  rules:
    - changes:
        - "**/*.yaml"
        - "**/*.yml"
  stage: lint
  before_script:
    - pip install tox
  script:
    - tox -e yamllint

# If you have mypy set up
# mypy:
#   stage: lint
#   script: tox -e mypy

py3:
  stage: tests
  script: tox -e py3

# If you have your project on readthedocs, you can automatically trigger its
# build by setting:
# - READTHEDOCS_TOKEN
# - READTHEDOCS_ID
# in your heptapod project Settings > CI/CD > Variables.
# You can find those secrets by creating a new integration in your readthedocs
# project here: https://readthedocs.org/dashboard/cubicweb_editorjs/integrations/
#
# Related documentation:
# https://docs.readthedocs.io/en/latest/webhooks.html#using-the-generic-api-integration
#
# trigger-readthedocs:
#   only:
#     refs:
#       - branch/default
#   stage: after-tests
#   script:
#   # 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_editorjs/${READTHEDOCS_ID} -w "\nhttp code:"\ "%{http_code}\n" -f