summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 878db320b8f28f7f6e2c8a212310144778a2cc62 (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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
variables:
    GIT_SUBMODULE_STRATEGY: normal
    BUNDLE: "nautilus-dev.flatpak"

stages:
    - test
    - cross_environment
    - deploy

.test_template: &distro_test
  script:
      - meson _build .
      - cd _build
      - ninja test

.flatpak_template: &flatpak
    script:
        - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
        # Make sure to keep this in sync with the Flatpak manifest, all arguments
        # are passed except the config-args because we build it ourselves
        - flatpak build app meson --prefix=/app --libdir=lib ${MESON_ARGS} _build
        - flatpak build app ninja -C _build install
        - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
        # Run automatic tests inside the Flatpak env
        # Setting LANG to avoid Tracker complaining and falling back to the same value,
        # and setting NO_AT_BRIDGE, so that atk-bridge isn’t initialized, preventing
        # annoying warnings that don’t affect the kinds of tests that we run.
        - |
          xvfb-run -a -s "-screen 0 1024x768x24" \
              flatpak build \
                  --env=LANG=C.UTF-8 \
                  --env=NO_AT_BRIDGE=1 \
                  app \
                  dbus-run-session meson test -C _build
        # Generate a Flatpak bundle
        - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
    artifacts:
        paths:
            - ${BUNDLE}
            - _build/meson-logs/
        # The Flatpak bundle is always generated at the end, meaning that there
        # won’t be one in case of failure, but the logs will be available for
        # our expert investigators to dissect.
        when: always
        expire_in: 2 days

flatpak devel:
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.30
    stage: test
    variables:
        MANIFEST_PATH: "build-aux/flatpak/org.gnome.Nautilus.yml"
        MESON_ARGS: "-Dprofile=Devel -Dtests=all"
        FLATPAK_MODULE: "nautilus"
        RUNTIME_REPO: "https://sdk.gnome.org/gnome.flatpakrepo"
        DBUS_ID: "org.gnome.NautilusDevel"
    <<: *flatpak

review:
    stage: deploy
    dependencies:
        - "flatpak devel"
    script:
        - echo "Generating flatpak deployment"
    artifacts:
        paths:
            - ${BUNDLE}
        expire_in: 30 days
    environment:
        name: review/$CI_COMMIT_REF_NAME
        url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
        on_stop: stop_review
    except:
        - master@GNOME/nautilus
        - tags

stop_review:
    stage: deploy
    script:
        - echo "Stopping flatpak deployment"
    when: manual
    environment:
        name: review/$CI_COMMIT_REF_NAME
        action: stop
    except:
        - master@GNOME/nautilus
        - tags

fedora rawhide:
    image: fedora:rawhide
    stage: cross_environment
    before_script:
        - dnf update -y --nogpgcheck
        - dnf install -y 'dnf-command(builddep)' redhat-rpm-config libseccomp-devel gcovr --nogpgcheck
        - dnf builddep -y nautilus --nogpgcheck
    script:
        - meson _build . -Db_coverage=true
        - cd _build
        - ninja test
        - gcovr --root=.
            --exclude=src/
            --exclude=../data/
            --exclude=../eel/check-program.c
            --exclude=../eel/eel-debug.c
            --exclude=../eel/eel-lib-self-check-functions.c
            --exclude=../eel/eel-self-checks.c
            --exclude=../src/animation/
            --exclude=../src/gtk/
            --exclude=../src/nautilus-lib-self-check-functions.c
            --exclude=../src/nautilus-self-check-functions.c
            --exclude=../subprojects/libgd/
            --exclude=../test/
    coverage: '/^TOTAL.*\s+(\d+\%)$/'

    only:
        - schedules
        - web
        - tags

ubuntu devel:
    image: ubuntu:devel
    stage: cross_environment
    variables:
        DEPENDENCIES: |
            git
            gcc
            meson
            gettext
            itstool
            gobject-introspection
            desktop-file-utils
            libxml2-dev
            libgtk-3-dev
            libgexiv2-dev
            libseccomp-dev
            libgnome-autoar-0-dev
            libgirepository1.0-dev
            libtracker-sparql-2.0-dev
            libtracker-control-2.0-dev
            gsettings-desktop-schemas-dev
    before_script:
        # Ubuntu requires running update to fetch metadata and find packges
        - apt-get update
        - apt-get install -y $DEPENDENCIES
    <<: *distro_test
    only:
        - schedules
        - web
        - tags

opensuse tumbleweed:
    image: opensuse:tumbleweed
    stage: cross_environment
    variables:
        DEPENDENCIES: |
            git
            gcc
            meson
            itstool
            gtk3-devel
            gettext-tools
            libxml2-devel
            tracker-devel
            libgexiv2-devel
            gettext-runtime
            gnome-autoar-devel
            desktop-file-utils
            gobject-introspection-devel
            gsettings-desktop-schemas-devel
            libseccomp-devel
    before_script:
        - zypper install -y $DEPENDENCIES
    <<: *distro_test
    only:
        - schedules
        - web
        - tags

flatpak master:
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
    stage: cross_environment
    variables:
        MANIFEST_PATH: "build-aux/flatpak/org.gnome.NautilusMaster.yml"
        MESON_ARGS: "-Dprofile=Master -Dtests=all"
        FLATPAK_MODULE: "nautilus"
        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
        DBUS_ID: "org.gnome.NautilusMaster"
    <<: *flatpak
    only:
        - schedules
        - web
        - tags

flatpak gtk4:
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
    stage: cross_environment
    variables:
        MANIFEST_PATH: "build-aux/flatpak/org.gnome.NautilusGtk4.yml"
        MESON_ARGS: "-Dprofile=Gtk4 -Dtests=all"
        FLATPAK_MODULE: "nautilus"
        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
        DBUS_ID: "org.gnome.NautilusGtk4"
    <<: *flatpak
    only:
        - schedules
        - web
        - tags