summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 6be9bf4af4c2d93c0c2a82d4d03ff802cfdca96c (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 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
  - aggregate-coverage
  - 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-coverage-without-optional-bd:
  stage: ci-test
  image: debian:unstable
  script:
    - apt-get update
    - apt-get build-dep -Ppkg.debputy.minimal-tests,pkg.debputy.test-coverage -y .
    - py.test-3 -v --cov --cov-branch --doctest-modules --junit-xml=xunit-report.xml --cov-report xml:coverage.xml
    - dpkg-buildpackage -Ppkg.debputy.minimal-tests -us -uc -tc
  after_script:
  - mkdir -p coverage-results/tests-unstable-coverage-without-optional-bd
  - cp .coverage coverage-results/tests-unstable-coverage-without-optional-bd/coverage
  artifacts:
    paths:
      - coverage-results/tests-unstable-coverage-without-optional-bd
    reports:
      junit: xunit-report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml

tests-unstable-coverage:
  stage: ci-test
  image: debian:unstable
  script:
    - apt-get update
    - apt-get build-dep -Ppkg.debputy.test-coverage -y .
    - py.test-3 -v --cov --cov-branch --doctest-modules --junit-xml=xunit-report.xml --cov-report xml:coverage.xml
  after_script:
  - mkdir -p coverage-results/tests-unstable-coverage
  - cp .coverage coverage-results/tests-unstable-coverage/coverage
  artifacts:
    paths:
      - coverage-results/tests-unstable-coverage
    reports:
      junit: xunit-report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml

tests-unstable-coverage-with-extra-bd:
  stage: ci-test
  image: debian:unstable
  script:
    - apt-get update
    - apt-get build-dep -Ppkg.debputy.ci,pkg.debputy.test-coverage -y .
    - py.test-3 -v --cov --cov-branch --doctest-modules --junit-xml=xunit-report.xml --cov-report xml:coverage.xml
  after_script:
  - mkdir -p coverage-results/tests-unstable-coverage-with-extra-bd
  - cp .coverage coverage-results/tests-unstable-coverage-with-extra-bd/coverage
  artifacts:
    paths:
      - coverage-results/tests-unstable-coverage-with-extra-bd
    reports:
      junit: xunit-report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml

aggregate-coverage:
  stage: aggregate-coverage
  image: debian:unstable
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  script:
  - apt-get update -y
  - apt-get install -y python3-coverage
  - python3-coverage combine coverage-results/*/coverage*
  - python3-coverage html -d coverage-report
  - python3-coverage report
  artifacts:
    paths:
    - coverage-report
  dependencies:
  - tests-unstable-coverage
  - tests-unstable-coverage-without-optional-bd
  - tests-unstable-coverage-with-extra-bd

pages:
  stage: pages
  script:
  - mkdir public
  - mv coverage-report public/
  dependencies:
  - aggregate-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)$/