15ad99bdfSmrg# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
25ad99bdfSmrg#
35ad99bdfSmrg# This CI uses the freedesktop.org ci-templates.
45ad99bdfSmrg# Please see the ci-templates documentation for details:
55ad99bdfSmrg# https://freedesktop.pages.freedesktop.org/ci-templates/
65ad99bdfSmrg
75ad99bdfSmrg.templates_sha: &template_sha 185ede0e9b9b1924b92306ab8b882a6294e92613 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
85ad99bdfSmrg
95ad99bdfSmrg
105ad99bdfSmrginclude:
115ad99bdfSmrg  # Arch container builder template
125ad99bdfSmrg  - project: 'freedesktop/ci-templates'
135ad99bdfSmrg    ref: *template_sha
145ad99bdfSmrg    file: '/templates/arch.yml'
155ad99bdfSmrg  - project: 'freedesktop/ci-templates'
165ad99bdfSmrg    ref: *template_sha
175ad99bdfSmrg    file: '/templates/ci-fairy.yml'
185ad99bdfSmrg  - template: Security/SAST.gitlab-ci.yml
195ad99bdfSmrg
205ad99bdfSmrg
215ad99bdfSmrgstages:
225ad99bdfSmrg  - prep             # prep work like rebuilding the container images if there is a change
235ad99bdfSmrg  - build            # for actually building and testing things in a container
245ad99bdfSmrg  - test
255ad99bdfSmrg  - deploy
265ad99bdfSmrg
275ad99bdfSmrg
285ad99bdfSmrgvariables:
295ad99bdfSmrg  FDO_UPSTREAM_REPO: 'xorg/lib/libpciaccess'
305ad99bdfSmrg  # The tag should be updated each time the list of packages is updated.
315ad99bdfSmrg  # Changing a tag forces the associated image to be rebuilt.
325ad99bdfSmrg  # Note: the tag has no meaning, we use a date format purely for readability
335ad99bdfSmrg  FDO_DISTRIBUTION_TAG:  '2023-10-17.1'
345ad99bdfSmrg  FDO_DISTRIBUTION_PACKAGES: 'git meson ninja gcc pkgconf zlib'
355ad99bdfSmrg
365ad99bdfSmrg#
375ad99bdfSmrg# Verify that commit messages are as expected, signed-off, etc.
385ad99bdfSmrg#
395ad99bdfSmrgcheck-commits:
405ad99bdfSmrg  extends:
415ad99bdfSmrg    - .fdo.ci-fairy
425ad99bdfSmrg  stage: prep
435ad99bdfSmrg  script:
445ad99bdfSmrg    - ci-fairy check-commits --junit-xml=results.xml
455ad99bdfSmrg  except:
465ad99bdfSmrg    - master@xorg/lib/libpciaccess
475ad99bdfSmrg  variables:
485ad99bdfSmrg    GIT_DEPTH: 100
495ad99bdfSmrg  artifacts:
505ad99bdfSmrg    reports:
515ad99bdfSmrg      junit: results.xml
525ad99bdfSmrg
535ad99bdfSmrg#
545ad99bdfSmrg# Verify that the merge request has the allow-collaboration checkbox ticked
555ad99bdfSmrg#
565ad99bdfSmrgcheck-merge-request:
575ad99bdfSmrg  extends:
585ad99bdfSmrg    - .fdo.ci-fairy
595ad99bdfSmrg  stage: deploy
605ad99bdfSmrg  script:
615ad99bdfSmrg    - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
625ad99bdfSmrg  artifacts:
635ad99bdfSmrg    when: on_failure
645ad99bdfSmrg    reports:
655ad99bdfSmrg      junit: results.xml
665ad99bdfSmrg  allow_failure: true
675ad99bdfSmrg
685ad99bdfSmrg
695ad99bdfSmrg#
705ad99bdfSmrg# Build a container with the given tag and the packages pre-installed.
715ad99bdfSmrg# This only happens if/when the tag changes, otherwise the existing image is
725ad99bdfSmrg# re-used.
735ad99bdfSmrg#
745ad99bdfSmrgcontainer-prep:
755ad99bdfSmrg  extends:
765ad99bdfSmrg    - .fdo.container-build@arch
775ad99bdfSmrg  stage: prep
785ad99bdfSmrg  variables:
795ad99bdfSmrg    GIT_STRATEGY: none
805ad99bdfSmrg
815ad99bdfSmrg#
825ad99bdfSmrg# Builds run on the image built above.
835ad99bdfSmrg#
845ad99bdfSmrg
855ad99bdfSmrgmeson:
865ad99bdfSmrg  extends:
875ad99bdfSmrg    - .fdo.distribution-image@arch
885ad99bdfSmrg  stage: build
895ad99bdfSmrg  parallel:
905ad99bdfSmrg    matrix:
915ad99bdfSmrg      - MESON_OPTIONS: ['-Dzlib=disabled', '-Dzlib=enabled']
925ad99bdfSmrg  script:
935ad99bdfSmrg    - mkdir -p ../_inst
945ad99bdfSmrg    - meson setup builddir --prefix="$PWD/../_inst" -Dwarning_level=3 -Ddefault_library=both $MESON_OPTIONS
955ad99bdfSmrg    - meson configure builddir
965ad99bdfSmrg    - ninja -C builddir test
975ad99bdfSmrg    - ninja -C builddir install
98