summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 5b52c792f0f68fcb1750e0d28f626755093868ce (plain)
1
2
3
4
5
6
7
8
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# This CI config uses FDO ci-templates: https://freedesktop.pages.freedesktop.org/ci-templates/
include:
  - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ci-fairy.yml"
  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/alpine.yml'
  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/fedora.yml'
  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ubuntu.yml'

variables:
  G_MESSAGES_DEBUG: "libmediaart"
  # This can be used when debugging test failures that only occur within GitLab CI.
  MESON_TEST_EXTRA_ARGS: ""

stages:
  - prepare
  - test
  - docs
  - deploy

.libmediaart.fedora@common:
  variables:
    BASE_TAG: '2021-05-22.1'
    FDO_UPSTREAM_REPO: GNOME/libmediaart
    FDO_DISTRIBUTION_PACKAGES: 'git gdk-pixbuf2-devel gtk-doc meson'
    FDO_DISTRIBUTION_EXEC: |
      dnf install -y 'dnf-command(builddep)' &&
      dnf builddep -y libmediaart --setopt=install_weak_deps=False &&
      dnf clean all

.libmediaart.ubuntu@common:
  variables:
    BASE_TAG: '2021-05-22.1'
    FDO_UPSTREAM_REPO: GNOME/libmediaart
    FDO_DISTRIBUTION_PACKAGES: 'git libgdk-pixbuf-2.0-dev gtk-doc-tools meson'
    FDO_DISTRIBUTION_EXEC: |
      export DEBIAN_FRONTEND=noninteractive &&
      sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list &&
      apt-get -yq update && apt-get -yq upgrade &&
      apt-get -yq build-dep libmediaart

.libmediaart.alpine@common:
  variables:
    BASE_TAG: '2021-05-22.1'
    FDO_UPSTREAM_REPO: GNOME/libmediaart
    FDO_DISTRIBUTION_PACKAGES: 'alpine-sdk git glib-dev gtk-doc gobject-introspection-dev gdk-pixbuf-dev vala meson'

.libmediaart.fedora:rawhide@x86_64:
  extends: .libmediaart.fedora@common
  variables:
    FDO_DISTRIBUTION_VERSION: rawhide
    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"

.libmediaart.ubuntu:rolling@x86_64:
  extends: .libmediaart.ubuntu@common
  variables:
    FDO_DISTRIBUTION_VERSION: rolling
    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"

.libmediaart.alpine:edge@x86_64:
  extends: .libmediaart.alpine@common
  variables:
    FDO_DISTRIBUTION_VERSION: edge
    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"

build-fedora-container@x86_64:
  extends:
    - .fdo.container-build@fedora
    - .libmediaart.fedora:rawhide@x86_64
  stage: prepare
  variables:
    GIT_STRATEGY: none
  needs: []

build-ubuntu-container@x86_64:
  extends:
    - .fdo.container-build@ubuntu
    - .libmediaart.ubuntu:rolling@x86_64
  stage: prepare
  variables:
    GIT_STRATEGY: none
  needs: []

build-alpine-container@x86_64:
  extends:
    - .fdo.container-build@alpine
    - .libmediaart.alpine:edge@x86_64
  stage: prepare
  variables:
    GIT_STRATEGY: none
  needs: []

.test_template: &test
  stage: test

  script:
    - meson setup _build . -Dgtk_doc=true
    - meson compile -C _build
    - |
      # Remove the many "CI_" variables from the environment. Meson dumps the
      # whole environment for every failed test, and that gives a whole
      # screenful of junk each time unless we strip these.
      unset $(env|grep -o '^CI_[^=]*')
      env meson test -C _build --print-errorlogs ${MESON_TEST_EXTRA_ARGS}

  after_script:
    - |
      echo "Distribution: "
      echo
      egrep '^NAME=|^VERSION=' /etc/os-release
      echo
      echo "Test suite settings:"
      echo
      echo "G_MESSAGES_DEBUG: ${G_MESSAGES_DEBUG}"
      echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}"
      echo
      echo "These values can be set at https://gitlab.gnome.org/GNOME/libmediaart/pipelines/new"

  artifacts:
    when: always
    paths:
    - build/meson-logs/testlog.txt

test-alpine-edge:
  extends:
    - .fdo.distribution-image@alpine
    - .libmediaart.alpine:edge@x86_64
  needs:
    - build-alpine-container@x86_64
  <<: *test

test-fedora-latest:
  extends:
    - .fdo.distribution-image@fedora
    - .libmediaart.fedora:rawhide@x86_64
  needs:
    - build-fedora-container@x86_64
  <<: *test

test-ubuntu-rolling:
  extends:
    - .fdo.distribution-image@ubuntu
    - .libmediaart.ubuntu:rolling@x86_64
  needs:
    - build-ubuntu-container@x86_64
  <<: *test

documentation:
  extends:
    - .fdo.distribution-image@fedora
    - .libmediaart.fedora:rawhide@x86_64
  needs:
    - build-fedora-container@x86_64
  stage: docs
  script:
    - meson setup _build . -Dgtk_doc=true
    - meson compile -C _build
    - mv _build/docs/html _reference
  artifacts:
    paths:
      - _reference

pages:
  extends:
    - .fdo.distribution-image@fedora
    - .libmediaart.fedora:rawhide@x86_64
  stage: deploy
  script:
    - mv _reference/ public/
  artifacts:
    paths:
      - public
  needs:
    - documentation
  only:
    - master