-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
197 lines (176 loc) · 4.9 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
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
# SPDX-FileCopyrightText: 2017 Florian Müllner
#
# SPDX-License-Identifier: GPL-2.0-or-later
include:
- project: 'GNOME/citemplates'
file: 'flatpak/flatpak_ci_initiative.yml'
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
dist-job-name: "flatpak"
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/057b052e682d8e5a20c1eb2dd60d5b87d2b56856/templates/fedora.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/34f4ade99434043f88e164933f570301fd18b125/templates/ci-fairy.yml'
stages:
- pre_review
- prepare
- review
- build
- deploy
- housekeeping
default:
# Cancel jobs if newer commits are pushed to the branch
interruptible: true
# Auto-retry jobs in case of infra failures
retry:
max: 1
when:
- 'runner_system_failure'
- 'stuck_or_timeout_failure'
- 'scheduler_failure'
- 'api_failure'
variables:
FDO_UPSTREAM_REPO: GNOME/polari
FLATPAK_MODULE: "polari"
MANIFEST_PATH: "flatpak/org.gnome.Polari.json"
TARBALL_ARTIFACT_PATH: ".flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz"
BUNDLE: "polari-git.flatpak"
workflow:
rules:
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"'
when: never
- if: '$CI_MERGE_REQUEST_IID'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
.pipeline_guard: &pipeline_guard
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
- when: 'manual'
.polari.fedora:
variables:
FDO_DISTRIBUTION_VERSION: 41
FDO_DISTRIBUTION_TAG: '2024-12-18.0'
FDO_DISTRIBUTION_PACKAGES: >
meson gjs git
nodejs npm
FDO_DISTRIBUTION_EXEC: |
# For static analysis with eslint
npm install -g eslint@^8.0.0 eslint-plugin-jsdoc@^46.0.0 &&
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/World/javascript/gjs-ci-tools.git \
main
.prereview_req: &prereview_req
needs:
- check_commit_log
- check-merge-request
check_commit_log:
extends:
- .fdo.ci-fairy
stage: pre_review
script:
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
ci-fairy check-commits --junit-xml=commit-message-junit-report.xml ;
else
echo "Not a merge request" ;
fi
<<: *pipeline_guard
artifacts:
expire_in: 1 week
paths:
- commit-message-junit-report.xml
reports:
junit: commit-message-junit-report.xml
check-merge-request:
extends:
- .fdo.ci-fairy
stage: pre_review
script:
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
then
ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request-report.xml ;
else
echo "Not a merge request" ;
fi
<<: *pipeline_guard
artifacts:
expire_in: 1 week
paths:
- check-merge-request-report.xml
reports:
junit: check-merge-request-report.xml
check-reuse:
stage: pre_review
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint
build-fedora-container:
extends:
- .fdo.container-build@fedora@x86_64
- .polari.fedora
stage: prepare
<<: *prereview_req
eslint:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora
stage: review
variables:
LINT_LOG: "eslint-report.xml"
needs:
- build-fedora-container
script:
- eslint -o "$LINT_LOG" -f junit --resolve-plugins-relative-to $(npm root -g) src
artifacts:
paths:
- "$LINT_LOG"
reports:
junit: "$LINT_LOG"
js-check:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora
stage: review
needs:
- build-fedora-container
script:
- gjs-check-syntax
.flatpak-template:
stage: build
<<: *prereview_req
variables:
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "org.gnome.Polari"
extends: .flatpak
flatpak-snapshot:
variables:
BRANCH: "snapshot"
CONFIG_OPTS: "-Dsnapshot=true --werror --warnlevel 2"
extends: .flatpak-template
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
flatpak:
extends: .flatpak-template
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
- if: '$CI_COMMIT_TAG'
nightly:
extends: '.publish_nightly'
needs:
- flatpak
check-flatpak-deps:
image:
name: ghcr.io/flathub/flatpak-external-data-checker
entrypoint: [""]
stage: housekeeping
<<: *prereview_req
script:
- "/app/flatpak-external-data-checker ${MANIFEST_PATH}"
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $POLARI_SCHEDULED_JOB == "x-checker"'