.gitlab-ci.yml 4.31 KB
Newer Older
1 2 3 4 5 6 7 8
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:

# We can not do multi-level includes, so we need to manually include all of
# our templates here
include:
  # projects using these templates should not need to pull the bootstrap
  - local: '/bootstrap/bootstrap.yml'

9 10 11
  # Alpine container builder template
  # projects using this should reference this with the following:
  #
12
  # - project: 'freedesktop/ci-templates'
13 14 15 16 17 18 19 20 21
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/alpine.yml'
  #
  - local: '/templates/alpine.yml'
  - local: '/alpine-ci.yml'

  # Arch container builder template
  # projects using this should reference this with the following:
  #
22
  # - project: 'freedesktop/ci-templates'
23 24 25 26 27 28 29 30 31
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/arch.yml'
  #
  - local: '/templates/arch.yml'
  - local: '/arch-ci.yml'

  # Centos container builder template
  # projects using this should reference this with the following:
  #
32
  # - project: 'freedesktop/ci-templates'
33 34 35 36 37 38
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/centos.yml'
  #
  - local: '/templates/centos.yml'
  - local: '/centos-ci.yml'

39 40 41
  # Debian container builder template
  # projects using this should reference this with the following:
  #
42
  # - project: 'freedesktop/ci-templates'
43 44 45 46
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/debian.yml'
  #
  - local: '/templates/debian.yml'
47
  - local: '/debian-ci.yml'
48 49

  # Fedora container builder template
50 51
  # projects using this should reference this with the following:
  #
52
  # - project: 'freedesktop/ci-templates'
53 54 55
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/fedora.yml'
  #
56
  - local: '/templates/fedora.yml'
57
  - local: '/fedora-ci.yml'
58

Benjamin Tissoires's avatar
Benjamin Tissoires committed
59
  # Ubuntu container builder template
60 61
  # projects using this should reference this with the following:
  #
62
  # - project: 'freedesktop/ci-templates'
63 64 65
  #   ref: master # or git sha, see https://docs.gitlab.com/ee/ci/yaml/#includefile
  #   file: '/templates/ubuntu.yml'
  #
Benjamin Tissoires's avatar
Benjamin Tissoires committed
66
  - local: '/templates/ubuntu.yml'
67
  - local: '/ubuntu-ci.yml'
Benjamin Tissoires's avatar
Benjamin Tissoires committed
68

69
variables:
70 71
  BOOTSTRAP_TAG: '2020-03-04'
  QEMU_TAG: '2020-03-04'
72 73 74


stages:
75
  - sanity check
76
  - bootstrapping
77
  - bootstrapping_qemu
78 79
  - alpine_container_build
  - alpine_check
Benjamin Tissoires's avatar
Benjamin Tissoires committed
80 81
  - arch_container_build
  - arch_check
82 83
  - centos_container_build
  - centos_check
84 85 86 87
  - debian_container_build
  - debian_check
  - fedora_container_build
  - fedora_check
88 89
  - ubuntu_container_build
  - ubuntu_check
Peter Hutterer's avatar
Peter Hutterer committed
90
  - pages
91 92


93
#
94 95 96
# We want those to fail as early as possible, so we are using a plain fedora
# image, and there is no need to run `dnf update` as we only need to run
# one python script.
97
#
98 99

.pip_install:
100
  stage: sanity check
101 102 103 104 105 106 107 108
  image: fedora:31
  before_script:
    - curl https://bootstrap.pypa.io/get-pip.py -o /root/get-pip.py
    - python3 /root/get-pip.py
    - dnf install -y git-core

sanity check:
  extends: .pip_install
109 110 111 112 113 114 115 116
  script:
    - pip3 install --user jinja2 PyYAML
    - python3 ./src/generate_templates.py

    - git diff --exit-code && exit 0 || true

    - echo "some files were not generated through 'src/generate_templates.py' or
      have not been committed. Please edit the files under 'src', run
Bastien Nocera's avatar
Bastien Nocera committed
117
      'src/generate_templates.py' and then commit the result"
118 119
    - exit 1

120 121

check commits:
122
  extends: .pip_install
123 124 125 126 127 128 129 130 131
  script:
    - pip3 install GitPython
    - pip3 install pytest
    - |
      pytest --junitxml=results.xml \
             --tb=line \
             --assert=plain \
             ./.gitlab-ci/check-commit.py
  except:
132
    - master@freedesktop/ci-templates
133 134
  variables:
    GIT_DEPTH: 100
135
    GIT_STRATEGY: clone
136 137 138 139
  artifacts:
    reports:
      junit: results.xml

Peter Hutterer's avatar
Peter Hutterer committed
140 141 142 143
pages:
  extends: .pip_install
  stage: pages
  script:
144
  - pip3 install sphinx sphinx-rtd-theme sphinxcontrib-autoyaml
Peter Hutterer's avatar
Peter Hutterer committed
145 146 147 148 149
  - bash -x doc/build-docs.sh
  - mv build/html public
  artifacts:
    paths:
    - public
150

151 152
bootstrap:
  extends: .bootstrap
153 154
  needs:
    - sanity check
155 156


157
bootstrap@arm64v8:
158 159
  extends: .bootstrap@arm64v8
  needs:
160 161 162 163 164 165 166
    - sanity check


bootstrap-qemu:
  extends: .qemu
  needs:
    - sanity check
167 168 169 170 171 172 173
    - bootstrap


bootstrap-qemu-mkosi:
  extends: .qemu-mkosi
  needs:
    - sanity check
174
    - bootstrap