summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 1543f14511a4c259c343cb5b44e18af53fe79b88 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# TODO: Figure out if we can reuse these jobs but run them after our own checks without having
#  to manually merge `stages`.
include:
  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml


stages:
  - ci-test
  - pages
  - provisioning
  - build
  - publish
  - test

tests-testing:
  stage: ci-test
  image: debian:testing
  script:
    - apt-get update
    - apt-get build-dep -y .
    - dpkg-buildpackage -us -uc -tc

tests-unstable:
  stage: ci-test
  image: debian:unstable
  script:
    - apt-get update
    - apt-get build-dep -Ppkg.debputy.ci -y .
    - dpkg-buildpackage -Ppkg.debputy.ci -us -uc -tc

tests-unstable-without-optional-bd:
  stage: ci-test
  image: debian:unstable
  script:
    - apt-get update
    - apt-get build-dep -Ppkg.debputy.minimal-tests -y .
    - dpkg-buildpackage -Ppkg.debputy.minimal-tests -us -uc -tc

tests-unstable-coverage:
  stage: ci-test
  image: debian:unstable
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  script:
    - apt-get update
    - apt-get build-dep -y .
    - apt-get install -y python3-pytest-cov
    - PYTHONPATH=. py.test-3 -v --cov --cov-branch --doctest-modules --junit-xml=xunit-report.xml --cov-report term --cov-report html:htmlcov --cov-report xml:coverage.xml
  after_script:
  - apt-get install python3-coverage
  - python3-coverage html
  artifacts:
    paths:
      - htmlcov
    reports:
      junit: xunit-report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml

pages:
  stage: pages
  script:
  - mkdir public
  - mv htmlcov public/
  dependencies:
    - tests-unstable-coverage
  artifacts:
    paths:
    - public
  only:
  - main

variables:
  SALSA_CI_DISABLE_WRAP_AND_SORT: 0
  SALSA_CI_WRAP_AND_SORT_ARGS: '-abkt'
  SALSA_CI_AUTOPKGTEST_ALLOWED_EXIT_STATUS: 0
  SALSA_CI_DISABLE_APTLY: 0

debputy-lint:
  stage: ci-test
  image: debian:sid-slim
  script:
    - apt-get update -qq && apt-get -qq install --no-install-recommends --yes dh-debputy python3-pygls
    - PERL5LIB=lib debputy lint --spellcheck
  except:
    variables:
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/