# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0: .templates_sha: &template_sha d303fafa66bbca44cc5bdb337d5773b5f019b70d # see https://docs.gitlab.com/ee/ci/yaml/#includefile include: # Arch container builder template - project: 'freedesktop/ci-templates' ref: *template_sha file: '/templates/arch.yml' # global variables to be used by most/all jobs. variables: FDO_UPSTREAM_REPO: 'xkeyboard-config/xkeyboard-config' BUILDDIR: '_build' # installation directory must be inside $CI_PROJECT_DIR to allow for artifact caching INSTDIR: '$CI_PROJECT_DIR/_inst' # Override these in the jobs to pass commands to configure/make CONFIGURE_ARGS: '' MAKE_EXTRA_ARG: '' # Changing the tag will rebuild the container images. The value is just a # string, but we use the date for human benefits. FDO_DISTRIBUTION_TAG: '2020-11-06.0' stages: - prep - build - dist - test - gitlab container-prep: extends: - .fdo.container-build@arch stage: prep variables: GIT_STRATEGY: none # minimal set of packages required to build xkeyboard-config. BASE_PACKAGES: 'xorg-util-macros autoconf automake make gettext pkg-config gcc grep m4 python meson ninja git' # extra packages we need for various tests EXTRA_PACKAGES: 'tree libxml2 bison xorg-xkbcomp python-pytest' FDO_DISTRIBUTION_PACKAGES: $BASE_PACKAGES $EXTRA_PACKAGES .default_setup: extends: - .fdo.distribution-image@arch .default_build: extends: .default_setup script: - rm -rf "$BUILDDIR" - mkdir -p "$BUILDDIR" - mkdir -p "$INSTDIR" - autoreconf -ivf - pushd "$BUILDDIR" - ../configure --prefix="$INSTDIR" --disable-silent-rules --disable-runtime-deps "$CONFIGURE_ARGS" - make - if test x"$MAKE_EXTRA_COMMAND" != "x"; then make $MAKE_EXTRA_COMMAND; fi .meson_build: extends: .default_setup script: - if [ x"$TARBALL" != "x" ]; then mkdir tarball; tar xf "$BUILDDIR/$TARBALL" -C tarball/ --strip-components=1; pushd tarball > /dev/null; fi - meson "$BUILDDIR" -Dprefix="$INSTDIR" - meson configure "$BUILDDIR" - ninja -C "$BUILDDIR" - if test x"$NINJA_EXTRA_COMMAND" != "x"; then ninja -C "$BUILDDIR" $NINJA_EXTRA_COMMAND; fi # # Verify that the merge request has the allow-collaboration checkbox ticked # check-merge-request: image: golang:alpine stage: gitlab before_script: - apk add python3 py-pip git - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates script: - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml artifacts: when: on_failure reports: junit: results.xml allow_failure: true dependencies: [] make_install: extends: .default_build stage: build variables: MAKE_EXTRA_COMMAND: "install" after_script: - tree $INSTDIR artifacts: name: installed files expire_in: 2 weeks paths: - $INSTDIR/ make_check: extends: .default_build stage: build variables: MAKE_EXTRA_COMMAND: "check" make_distcheck: extends: .default_build stage: build variables: # pass VERSION to make so our tarball has a fixed name. MAKE_EXTRA_COMMAND: "VERSION=master distcheck" artifacts: name: tarball expire_in: 2 weeks paths: - $BUILDDIR/xkeyboard-config-master.tar.bz2 meson_build: extends: .meson_build stage: build variables: NINJA_EXTRA_COMMAND: "install" after_script: - tree $INSTDIR artifacts: name: installed files expire_in: 2 weeks paths: - $INSTDIR/ meson_test: extends: .meson_build stage: build variables: NINJA_EXTRA_COMMAND: "test" meston_dist: extends: .meson_build stage: build variables: NINJA_EXTRA_COMMAND: "dist" meson_from_tarball: extends: .meson_build stage: dist dependencies: - make_distcheck variables: TARBALL: "xkeyboard-config-master.tar.bz2" GIT_STRATEGY: none xmllint: extends: - .default_setup dependencies: ['make_install'] needs: ['make_install'] stage: test script: - xmllint --dtdvalid "$INSTDIR/share/X11/xkb/rules/xkb.dtd" $INSTDIR/share/X11/xkb/rules/*.xml > /dev/null # download libxkbcommon and run its layout test program. This will # run a basic keymap compile test against every combination of # layout/variant/option. Syntax errors will fail the test, check the # archived file for details. layout_tests: extends: .default_setup stage: test needs: ["make_install"] script: - git clone https://github.com/xkbcommon/libxkbcommon - pushd libxkbcommon > /dev/null - meson builddir -Denable-wayland=false -Denable-x11=false -Denable-docs=false -Dxkb-config-root="$INSTDIR/share/X11/xkb" - ninja -C builddir - echo Running test script - this will take several minutes - ./builddir/xkeyboard-config-test "$INSTDIR/share/X11/xkb/rules/evdev.xml" > $INSTDIR/xkeyboard-config-test.out - ./builddir/xkeyboard-config-test "$INSTDIR/share/X11/xkb/rules/evdev.extras.xml" >> $INSTDIR/xkeyboard-config-test.out - popd > /dev/null - xz -z "$INSTDIR/xkeyboard-config-test.out" variables: GIT_STRATEGY: none artifacts: name: xkeyboard-config test output expire_in: 2 weeks paths: - $INSTDIR/xkeyboard-config-test.out.xz keymap_tests: extends: .default_setup stage: test script: - export XKB_CONFIG_ROOT="$INSTDIR/share/X11/xkb" - pytest --junitxml=results.xml artifacts: reports: junit: results.xml # use the installed tree from the make_install job needs: - job: make_install artifacts: true