.gitlab-ci.yml 4.06 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 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
  # Alpine container builder template
  # projects using this should reference this with the following:
  #
  # - project: 'wayland/ci-templates'
  #   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:
  #
  # - project: 'wayland/ci-templates'
  #   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:
  #
  # - project: 'wayland/ci-templates'
  #   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: 'wayland/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 52 53 54 55
  # projects using this should reference this with the following:
  #
  # - project: 'wayland/ci-templates'
  #   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 62 63 64 65
  # projects using this should reference this with the following:
  #
  # - project: 'wayland/ci-templates'
  #   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
  BOOTSTRAP_TAG: '2020-02-19'
71
  QEMU_TAG: '2020-02-21'
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
90 91


92
#
93 94 95
# 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.
96
#
97 98

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

119 120

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


140 141
bootstrap:
  extends: .bootstrap
142 143
  needs:
    - sanity check
144 145


146
bootstrap@arm64v8:
147 148
  extends: .bootstrap@arm64v8
  needs:
149 150 151 152 153 154 155
    - sanity check


bootstrap-qemu:
  extends: .qemu
  needs:
    - sanity check
156 157 158 159 160 161 162
    - bootstrap


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