.gitlab-ci.yml 6.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# Quick syntax check:
# python -c 'import sys, yaml; yaml.dump (yaml.load (sys.stdin), sys.stdout)' <.gitlab-ci.yml

# If things don't seem to work, this can help:
# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/ci/lint

stages:
  - test
  - deploy

.fedora_install: &fedora_install
  before_script:
13 14 15 16 17 18 19 20

    # enable EPEL on CentOS
    - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || (yum install -y glibc-common && localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 && locale -a)

    - date '+%Y%m%d-%H%M%S'; NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
    - date '+%Y%m%d-%H%M%S'; yum install -y glibc-langpack-pl ccache clang which
21 22 23

    # containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
    # to generate proper documentation.
24
    - date '+%Y%m%d-%H%M%S'; yum reinstall -y --setopt='tsflags=' glib2-doc
25

26 27 28 29 30
    - date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || yum install -y python36-dbus python36-gobject-base

    - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf install -y python3-dnf-plugins-core
    - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf debuginfo-install -y glib2
    - date '+%Y%m%d-%H%M%S';   which dnf || debuginfo-install -y glib2
31

32
    - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true
33

34 35
    - date '+%Y%m%d-%H%M%S'; test -x /usr/bin/ninja || ! test -x /usr/bin/ninja-build || ln -s /usr/bin/ninja-build /usr/bin/ninja

36 37 38 39 40 41 42 43
.debian_install: &debian_install
  before_script:
    - date '+%Y%m%d-%H%M%S'; apt-get update
    - date '+%Y%m%d-%H%M%S'; NM_INSTALL="apt-get -qq install -y" ./contrib/debian/REQUIRED_PACKAGES
    - date '+%Y%m%d-%H%M%S'; dbus-uuidgen --ensure
    - date '+%Y%m%d-%H%M%S'; sed -i 's/^# \(pl_PL.UTF-8 .*\)$/\1/p' /etc/locale.gen ; true
    - date '+%Y%m%d-%H%M%S'; locale-gen pl_PL.UTF-8
    - date '+%Y%m%d-%H%M%S'; pip3 install meson
44
    - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh
45

46 47 48 49
    # iproute2 5.2.0 on debian:sid causes our unit tests to fail.
    # Downgrade to a working version. See https://www.spinics.net/lists/netdev/msg584916.html
    - date '+%Y%m%d-%H%M%S'; ! ( dpkg -s iproute2 | grep -q '^Version[:] 5.2.0-1$' ) || (curl 'http://ftp.debian.org/debian/pool/main/i/iproute2/iproute2_4.20.0-2_amd64.deb' --output /tmp/iproute2_4.20.0-2_amd64.deb && dpkg -i /tmp/iproute2_4.20.0-2_amd64.deb)

50
.do_build: &do_build
51 52
  stage: test
  script:
53
    - date '+%Y%m%d-%H%M%S'; uname -a
54 55 56
    - date '+%Y%m%d-%H%M%S'; locale -a
    - date '+%Y%m%d-%H%M%S'; env
    - date '+%Y%m%d-%H%M%S'; meson --version
57
    - date '+%Y%m%d-%H%M%S'; ! which dpkg || dpkg -l
58
    - date '+%Y%m%d-%H%M%S'; ! which yum  || yum list installed
59
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=gcc   WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
60
    - date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html
61
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson     CC=gcc   WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
62 63
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson     CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
64 65
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\|CentOS\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\)'         /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
66 67
    - date '+%Y%m%d-%H%M%S'; git clean -fdx ; test "$NM_BUILD_TARBALL" != 1 || ( ./contrib/fedora/rpm/build_clean.sh -r && mv ./NetworkManager-1*.tar.xz /tmp/ && mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm /tmp/ )
    - date '+%Y%m%d-%H%M%S'; git clean -fdx
68
    - date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html
69
    - date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./
70

71
checkpatch:
72
  image: fedora:29
73 74
  stage: test
  script:
75 76
    - date '+%Y%m%d-%H%M%S'; dnf install -y git
    - date '+%Y%m%d-%H%M%S'; contrib/scripts/checkpatch-feature-branch.sh 2>&1 | tee checkpatch-out.txt
77 78 79 80 81 82
  allow_failure: true
  artifacts:
    when: on_failure
    paths:
      - checkpatch-out.txt

83
t_fedora:28:
84 85
  <<: *fedora_install
  image: fedora:28
86
  <<: *do_build
87

88
t_fedora:29:
89
  <<: *fedora_install
90
  image: fedora:29
91
  <<: *do_build
92 93 94 95 96 97 98 99
  variables:
    NM_BUILD_TARBALL: 1
  artifacts:
    expire_in: 2 days
    paths:
      - docs-html
      - NetworkManager-1*.tar.xz
      - NetworkManager-1*.src.rpm
100

101
t_fedora:30:
102 103
  <<: *fedora_install
  image: fedora:30
104
  <<: *do_build
105

106
t_fedora:rawhide:
107 108
  <<: *fedora_install
  image: fedora:rawhide
109
  <<: *do_build
110
  allow_failure: true
111 112
  when: manual

113 114 115 116 117 118 119 120 121 122 123
t_centos:7.5.1804:
  <<: *fedora_install
  image: centos:7.5.1804
  <<: *do_build
  when: manual

t_centos:7.6.1810:
  <<: *fedora_install
  image: centos:7.6.1810
  <<: *do_build

124 125 126 127 128 129 130 131 132 133
t_ubuntu:16.04:
  <<: *debian_install
  image: ubuntu:16.04
  <<: *do_build

t_ubuntu:18.04:
  <<: *debian_install
  image: ubuntu:18.04
  <<: *do_build

134 135 136 137 138 139 140 141 142 143 144 145
t_ubuntu:rolling:
  <<: *debian_install
  image: ubuntu:rolling
  <<: *do_build
  when: manual

t_ubuntu:devel:
  <<: *debian_install
  image: ubuntu:devel
  <<: *do_build
  when: manual

146 147 148 149 150
t_debian:9:
  <<: *debian_install
  image: debian:stretch
  <<: *do_build

151 152 153 154 155
t_debian:10:
  <<: *debian_install
  image: debian:stretch
  <<: *do_build

156 157 158 159 160 161 162 163 164 165
t_debian:testing:
  <<: *debian_install
  image: debian:testing
  <<: *do_build
  when: manual

t_debian:sid:
  <<: *debian_install
  image: debian:sid
  <<: *do_build
166

167 168 169
pages:
  stage: deploy
  dependencies:
170
    - t_fedora:29
171 172 173 174 175 176 177 178
  script:
    - mv docs-html public
  artifacts:
    expire_in: 20 days
    paths:
      - public
  only:
    - master