.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