[go: up one dir, main page]

File: .gitlab-ci.yml

package info (click to toggle)
ibus-cangjie 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 540 kB
  • sloc: python: 2,125; xml: 210; sh: 35; makefile: 8
file content (308 lines) | stat: -rw-r--r-- 6,942 bytes parent folder | download
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
.templates_sha: &templates_sha b61a03cabbf308e81289f7aaaf0b5a80a34ffb99

include:
  - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
  - project: 'freedesktop/ci-templates'     # the project to include from
    ref: *templates_sha                 # git ref of that project
    file: '/templates/fedora.yml'       # the actual file to include
  - project: 'freedesktop/ci-templates'
    ref: *templates_sha
    file: '/templates/ubuntu.yml'

# From https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/master/src/gitlab-ci.tmpl
workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - if: $CI_COMMIT_BRANCH

variables:
  BUILD_IMAGE_REGISTRY: registry.freedesktop.org/cangjie/pycangjie
  FEDORA_PACKAGES: >
    black
    ca-certificates
    desktop-file-utils
    gcc
    gcovr
    gettext
    git
    gobject-introspection
    gsound
    gtk4
    gtk-update-icon-cache
    ibus-devel
    libadwaita
    lcov
    meson
    pkg-config
    python3-coverage
    python3-gobject
    python3-mypy
    python3-packaging
    python3-pip
    python3-cangjie
  UBUNTU_PACKAGES: >
    black
    ca-certificates
    desktop-file-utils
    gcc
    gcovr
    gettext
    git
    gobject-introspection
    gir1.2-adw-1
    gir1.2-gdk-4.0
    gir1.2-gsound-1.0
    gir1.2-gtk-4.0
    libadwaita-1-0
    libgtk-4-1
    gtk-update-icon-cache
    libibus-1.0-dev
    lcov
    meson
    pkg-config
    python3-coverage
    python3-gi
    python3-packaging
    python3-pip
    python3-pycangjie
  FDO_UPSTREAM_REPO: cangjie/ibus-cangjie

  FEDORA_TAG: "2024-11-03.0"
  UBUNTU_TAG: "2024-11-03.0"

  MESON_BUILDDIR: "builddir"
  NINJA_ARGS: ""
  MESON_ARGS: "--prefix=/usr"
  MESON_TEST_ARGS: ""

.policy:
  retry:
    max: 2
    when:
      - 'runner_system_failure'
      - 'stuck_or_timeout_failure'
      - 'scheduler_failure'
      - 'api_failure'
  interruptible: true

.default-fedora-variables:
  variables:
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG

.default-ubuntu-variables:
  variables:
    FDO_DISTRIBUTION_PACKAGES: $UBUNTU_PACKAGES
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG

.default-artifacts:
  artifacts:
    paths:
      - builddir/meson-dist/ibus-cangjie-*.tar.xz
      - builddir/meson-logs
    expire_in: "1 week"

.default-scripts:
  before_script:
    # The "--break-system-packages" flag is needed to forcefully install the
    # package globally on Debian-based systems.
    - pip3 install --break-system-packages colour-runner
  script:
    - meson setup ${MESON_ARGS} ${MESON_BUILDDIR}
    - meson compile -C ${MESON_BUILDDIR}
    - meson dist -C ${MESON_BUILDDIR}
    - meson test --verbose -C ${MESON_BUILDDIR}
    - python3 -m coverage report | tee builddir/meson-logs/coveragereport.txt

stages:
  - prep
  - health
  - test

# Fedora Latest (41)
prep-fedora-latest:
  extends:
    - .fdo.container-build@fedora
    - .default-fedora-variables
  stage: 'prep'
  variables:
    FDO_DISTRIBUTION_VERSION: '41'

test-fedora-latest:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
    - .default-artifacts
    - .default-scripts
  variables:
    FDO_DISTRIBUTION_VERSION: '41'
  stage: 'test'
  needs:
    - prep-fedora-latest

# Fedora Rawhide
prep-fedora-rawhide:
  extends:
    - .fdo.container-build@fedora
    - .default-fedora-variables
  stage: 'prep'
  variables:
    FDO_DISTRIBUTION_VERSION: rawhide
  allow_failure: true

test-fedora-rawhide:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
    - .default-artifacts
    - .default-scripts
  variables:
    FDO_DISTRIBUTION_VERSION: rawhide
  stage: 'test'
  needs:
    - prep-fedora-rawhide
  allow_failure: true

# Ubuntu Devel (Plucky)
prep-ubuntu-devel:
  extends:
    - .fdo.container-build@ubuntu
    - .default-ubuntu-variables
  stage: 'prep'
  variables:
    FDO_DISTRIBUTION_VERSION: 'devel'
  allow_failure: true

test-ubuntu-devel:
  extends:
    - .fdo.distribution-image@ubuntu
    - .default-ubuntu-variables
    - .default-artifacts
    - .default-scripts
  stage: test
  variables:
    FDO_DISTRIBUTION_VERSION: 'devel'
  needs:
    - prep-ubuntu-devel
  allow_failure: true

# Ubuntu Latest (Oracular)
prep-ubuntu-latest:
  extends:
    - .fdo.container-build@ubuntu
    - .default-ubuntu-variables
  stage: 'prep'
  variables:
    FDO_DISTRIBUTION_VERSION: '24.10'

test-ubuntu-latest:
  extends:
    - .fdo.distribution-image@ubuntu
    - .default-ubuntu-variables
    - .default-artifacts
    - .default-scripts
  stage: test
  variables:
    FDO_DISTRIBUTION_VERSION: '24.10'
  needs:
    - prep-ubuntu-latest

# Ubuntu LTS (Noble)
prep-ubuntu-latest:
  extends:
    - .fdo.container-build@ubuntu
    - .default-ubuntu-variables
  stage: 'prep'
  variables:
    FDO_DISTRIBUTION_VERSION: '24.04'

test-ubuntu-latest:
  extends:
    - .fdo.distribution-image@ubuntu
    - .default-ubuntu-variables
    - .default-artifacts
    - .default-scripts
  variables:
    FDO_DISTRIBUTION_VERSION: '24.04'
  needs:
    - prep-ubuntu-latest

code-style-checks:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
  stage: health
  script:
    # Code Linter
    - black --diff --color --check .
  variables:
    FDO_DISTRIBUTION_VERSION: '41'
  needs:
    - prep-fedora-latest

misc-format-checks:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
  stage: health
  before_script:
    - pip3 install editorconfig-checker
  script:
    - ec .
  variables:
    FDO_DISTRIBUTION_VERSION: '41'
  needs:
    - prep-fedora-latest

typing-checks:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
  stage: health
  script:
    # Static analysis
    - mypy ./src ./tests
  variables:
    FDO_DISTRIBUTION_VERSION: '41'
  needs:
    - prep-fedora-latest

i18n-checks:
  extends:
    - .fdo.distribution-image@fedora
    - .default-fedora-variables
  stage: health
  script:
    - |
      # po/POTFILES.in check

      echo -e "\033[39;1mCheck if all files covered in translations are still here\033[0m"
      MISSING=0
      echo "----"
      if [ -f ./po/POTFILES.in ]; then
        for FN in $(cat ./po/POTFILES.in); do
          if [ ! -f "$FN" ]; then
            echo -e "\033[31mMissing:\033[0m $FN"
            MISSING=1
          else
            echo -e "\033[32mFile found:\033[0m $FN"
          fi
        done
      fi
      if [ $MISSING -ne 0 ]; then
        echo "----"
        echo -e "\033[31;1mERROR: Some file is missing.\033[0m"
        echo "File(s) might be moved or deleted. Please update ./po/POTFILES.in"
        echo "----"
        exit 1
      else
        echo "----"
        echo -e "\033[32;1mOK: All files are found.\033[0m"
        echo "----"
      fi
  variables:
    FDO_DISTRIBUTION_VERSION: '41'
  needs:
    - prep-fedora-latest