-
Notifications
You must be signed in to change notification settings - Fork 38
/
.gitlab-ci.yml
148 lines (139 loc) · 4.67 KB
/
.gitlab-ci.yml
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
include:
- project: 'GNOME/citemplates'
file: '/flatpak/flatpak_ci_initiative.yml'
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
dist-job-name: "dist"
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
stages:
- build
- deploy
cache:
paths:
- _ccache/
variables:
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-software/fedora:v20"
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-software/debian:v20"
MESON_TEST_TIMEOUT_MULTIPLIER: 4
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--werror --buildtype debug --wrap-mode=nodownload --prefix /usr -Dwebapps=true -Dhardcoded_foss_webapps=false -Dhardcoded_proprietary_webapps=false"
BUNDLE: "gnome-software-dev.flatpak"
# -O2 is needed for -Wnull-dereference to work:
CFLAGS: "-O2"
# expected naming scheme for the release-service job
TARBALL_ARTIFACT_PATH: "_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz"
.build:
before_script:
- cp -r $HOME/subprojects/* subprojects/
# FIXME: Work around https://gitlab.com/gitlab-org/gitlab/-/issues/391756
- git config --global --add safe.directory "${PWD}"
fedora-x86_64:
extends: .build
image: "${FEDORA_IMAGE}"
stage: build
except:
- tags
script:
- meson setup ${MESON_COMMON_OPTIONS}
-Ddkms=true
-Drpm_ostree=true
-Dmalcontent=true
-Dsysprof=enabled
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
--no-suite packagekit
--no-suite fwupd
--no-suite gtk
--no-suite libglib-testing
--no-suite malcontent
artifacts:
reports:
junit: "_build/${CI_JOB_NAME}-report.xml"
name: "gnome-software-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
- "_build/${CI_JOB_NAME}-report.xml"
debian-x86_64:
extends: .build
image: "${DEBIAN_IMAGE}"
stage: build
except:
- tags
script:
- meson setup ${MESON_COMMON_OPTIONS}
-Ddkms=true
-Drpm_ostree=false
-Dmalcontent=false
-Dsysprof=disabled
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
--no-suite packagekit
--no-suite fwupd
--no-suite gtk
--no-suite fedora-langpacks
--no-suite libxmlb
artifacts:
reports:
junit: "_build/${CI_JOB_NAME}-report.xml"
name: "gnome-software-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
- "_build/${CI_JOB_NAME}-report.xml"
# Allow building a flatpak on demand to test out the gnome-software UI
flatpak bundle:
extends: '.flatpak'
stage: 'build'
dependencies: []
variables:
MANIFEST_PATH: "build-aux/org.gnome.Software.Devel.json"
FLATPAK_MODULE: "gnome-software"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "org.gnome.Software.Devel"
when: manual
allow_failure: true
script:
# Modified from https://gitlab.gnome.org/GNOME/citemplates/-/blob/HEAD/flatpak/flatpak_ci_initiative.yml
# to drop the unit tests, since we don’t need them
- rewrite-flatpak-manifest "${MANIFEST_PATH}" "${FLATPAK_MODULE}" ${CONFIG_OPTS}
- flatpak-builder --user --disable-rofiles-fuse flatpak_app --repo=repo ${BRANCH:+--default-branch="${BRANCH}"} "${MANIFEST_PATH}"
# Generate a Flatpak bundle
- flatpak build-bundle repo "${BUNDLE}" --runtime-repo="${RUNTIME_REPO}" "${APP_ID}" "${BRANCH}"
- tar cf repo.tar repo/
# Due to the `only` clause in .publish_nightly, this will only publish on-demand
# builds to nightly.gnome.org if they are built from a commit on `main`
nightly:
extends: '.publish_nightly'
dependencies:
- 'flatpak bundle'
needs: ['flatpak bundle']
when: manual
dist:
extends: .build
image: "${FEDORA_IMAGE}"
stage: build
needs: []
only:
- schedules
- tags
script:
- meson setup ${MESON_COMMON_OPTIONS}
--buildtype release
-Dgtk_doc=true
_build
# We can’t run tests because it would run the `gtk` suite, which doesn’t work on CI
# There’s currently no way to selectively disable some suites at dist time.
- meson dist -C _build --no-tests
# Compile again to build the docs
- meson compile -C _build
- ninja -C _build gnome-software-doc
- tar -c -J -f "_build/gnome-software-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/doc/api html
artifacts:
paths:
- "${CI_PROJECT_DIR}/_build/gnome-software-docs-${CI_COMMIT_TAG}.tar.xz"
- "${CI_PROJECT_DIR}/_build/meson-dist/gnome-software-*.tar.xz"