.gitlab-ci.yml 4.44 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
    - date '+%Y%m%d-%H%M%S'; NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES
    - date '+%Y%m%d-%H%M%S'; dnf install -y glibc-langpack-pl ccache clang
15 16 17 18 19

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

20 21 22
    - date '+%Y%m%d-%H%M%S'; dnf install -y python3-dnf-plugins-core
    - date '+%Y%m%d-%H%M%S'; dnf debuginfo-install -y glib2

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

25 26 27 28 29 30 31 32
.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
33
    - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh
34 35

.do_build: &do_build
36 37
  stage: test
  script:
38
    - date '+%Y%m%d-%H%M%S'; uname -a
39 40 41
    - 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
42 43
    - date '+%Y%m%d-%H%M%S'; ! which dnf  || dnf list --installed
    - date '+%Y%m%d-%H%M%S'; ! which dpkg || dpkg -l
44
    - 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
45
    - date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html
46
    - 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
47 48
    - 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
49 50 51 52
    - 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
    - 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
    - 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
53
    - date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html
54
    - date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./
55

56 57 58 59
checkpatch:
  image: fedora:28
  stage: test
  script:
60 61
    - 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
62 63 64 65 66 67
  allow_failure: true
  artifacts:
    when: on_failure
    paths:
      - checkpatch-out.txt

68
t_fedora:28:
69 70
  <<: *fedora_install
  image: fedora:28
71
  <<: *do_build
72

73
t_fedora:29:
74
  <<: *fedora_install
75
  image: fedora:29
76
  <<: *do_build
77 78 79 80 81 82 83 84
  variables:
    NM_BUILD_TARBALL: 1
  artifacts:
    expire_in: 2 days
    paths:
      - docs-html
      - NetworkManager-1*.tar.xz
      - NetworkManager-1*.src.rpm
85

86
t_fedora:30:
87 88
  <<: *fedora_install
  image: fedora:30
89
  <<: *do_build
90

91
t_fedora:rawhide:
92 93
  <<: *fedora_install
  image: fedora:rawhide
94
  <<: *do_build
95
  allow_failure: true
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
  when: manual

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

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

t_debian:9:
  <<: *debian_install
  image: debian:stretch
  <<: *do_build

t_debian:testing:
  <<: *debian_install
  image: debian:testing
  <<: *do_build
  when: manual

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

124 125 126
pages:
  stage: deploy
  dependencies:
127
    - t_fedora:29
128 129 130 131 132 133 134 135
  script:
    - mv docs-html public
  artifacts:
    expire_in: 20 days
    paths:
      - public
  only:
    - master