.gitlab-ci.yml 4.52 KB
Newer Older
1 2 3 4 5 6 7

# 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'

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

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

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

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

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

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

68 69

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


88
#
89 90 91
# 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.
92
#
93 94

.pip_install:
95
  stage: sanity check
96 97 98 99 100 101 102 103
  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
104 105 106 107 108 109 110 111
  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
112
      'src/generate_templates.py' and then commit the result"
113 114
    - exit 1

115 116

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

135 136 137 138 139 140 141 142 143 144 145 146

pytest ci-fairy:
  extends: .pip_install
  script:
    - pip3 install pytest
    - pip3 install .
    - pytest --junitxml=results.xml
  artifacts:
    reports:
      junit: results.xml


Peter Hutterer's avatar
Peter Hutterer committed
147 148 149 150
pages:
  extends: .pip_install
  stage: pages
  script:
151 152 153 154
  - pip3 install sphinx sphinx-rtd-theme
  # Upstream bug in the HTML rendering for YAML nodes so let's used the fixed version
  # until this gets merged
  - pip3 install git+https://github.com/whot/sphinxcontrib-autoyaml.git@wip/fix-definition-rendering
Peter Hutterer's avatar
Peter Hutterer committed
155
  - bash -x doc/build-docs.sh
156
  - mv build public
Peter Hutterer's avatar
Peter Hutterer committed
157 158 159
  artifacts:
    paths:
    - public
160

161 162 163 164
bootstrap:
  extends: .bootstrap


165
bootstrap@arm64v8:
166
  extends: .bootstrap@arm64v8
167 168 169 170 171


bootstrap-qemu:
  extends: .qemu
  needs:
172 173 174 175 176 177
    - bootstrap


bootstrap-qemu-mkosi:
  extends: .qemu-mkosi
  needs:
178
    - bootstrap