include: - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/59de540b620c45739871d1a073d76d5521989d11/templates/fedora.yml' variables: FDO_DISTRIBUTION_TAG: latest FDO_DISTRIBUTION_VERSION: rawhide FDO_UPSTREAM_REPO: gnome/gnome-control-center # Expiry sets fdo.expires on the image FDO_EXPIRES_AFTER: 8w FEDORA_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG" # NOTES: # - gobject-introspection-devel is needed for gsettings-desktop-schemas FEDORA_DEPENDENCIES: > @c-development @development-tools git llvm clang libasan libtsan libubsan gcovr meson accountsservice-devel cheese-libs-devel chrpath colord-devel colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl flatpak-devel gdk-pixbuf2-devel gettext glib2-devel gobject-introspection-devel gnome-bluetooth-libs-devel gnome-desktop3-devel gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel gsettings-desktop-schemas-devel gsound-devel gtk3-devel ibus-devel intltool libcanberra-devel libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel libsoup-devel libudisks2-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt ModemManager-glib-devel NetworkManager-libnm-devel polkit-devel pulseaudio-libs-devel upower-devel python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel image: "$FEDORA_IMAGE" stages: - build - test - manual - deploy .Log files: &log_files [./*.log, _build/meson-logs/] .Build logs: &save_build_logs artifacts: name: log when: always paths: *log_files .Git Untracked files: &save_untracked_files artifacts: name: untracked paths: [$(pwd)] expire_in: 3h30min .Show Info: &environment_information build-aux/ci/ci-helper.sh "INFO" && build-aux/ci/ci-helper.sh "GIT_INFO" .Build procedure: &build_procedure echo "== Building ==" && rm -rf _build/ && meson . _build ${BUILD_OPTS} -Dprofile=development && ninja -C _build 2>&1 | tee compilation.log .Run Tests: &run_tests echo "== Testing ==" && meson test -C _build --verbose --no-stdsplit ## # Stage: Build # # Checks if GNOME Control Center is properly building and installing. This is the # most important stage of the CI, and no MR should ever be merged if it breaks # any of them. ## build: <<: *save_untracked_files stage: build script: - *environment_information - *build_procedure - echo "== Installing ==" - ninja -C _build install - echo "== Report ==" - build-aux/ci/ci-helper.sh "WARNINGS" # Save all but git-related files - rm -rf .git .gitignore .gitmodules except: variables: - $CI_PIPELINE_SOURCE == "schedule" ## # Stage: Test # # Runs the unit tests. ## test: <<: *save_build_logs stage: test dependencies: - build script: - *environment_information - *run_tests - | if [[ -n "${CI_COMMIT_TAG}" ]]; then echo "== Distro Test ==" ninja dist -C _build fi except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ # Runs the coverage test. coverage: <<: *save_build_logs stage: test variables: BUILD_OPTS: "-Db_coverage=true" coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/' only: - master@GNOME/gnome-control-center script: - *environment_information - *build_procedure - *run_tests - ninja -C _build coverage-html # Parse the report to get the coverage result - | echo == Coverage == sed -e 's/<[^>]*>//g' _build/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ # Runs the address sanitizer. # - below, at the "sanitizers section" ## # Stage: Deploy # # Publishes the Coverage Report generated above ## pages: stage: deploy dependencies: - coverage script: - mv _build/meson-logs/coveragereport/ public/ artifacts: paths: - public only: - master@GNOME/gnome-control-center except: variables: - $CRON_TASK == "BUILD_CI_IMAGES" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ ## # Stage: Manual # # Creates a flatpak ## flatpak: stage: manual image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master artifacts: name: package paths: - $(pwd)/*.flatpak expire_in: 7 days variables: OLD_APPID: "org.gnome.Settings" APPID: "org.gnome.SettingsDevel" BUNDLE: "org.gnome.SettingsDevel.flatpak" MANIFEST_PATH: "org.gnome.Settings.json" PATCHES: "build-aux/flatpak/*.patch" PROJECT_FILE: "build-aux/flatpak/org.gnome.Settings.json" PROJECT_ID: "org.gnome.Settings" PROJECT_NAME: "gnome-control-center.git" RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo" script: - echo "== Flatpak packaging ==" # Move needed files to the root folder - cp ${PATCHES} . || true - cp ${PROJECT_FILE} ${MANIFEST_PATH} # Make it a develoment manifest - sed -i -n "p; s/$PROJECT_NAME//p" ${MANIFEST_PATH} - > sed -i "s,\"app-id\" : \"$PROJECT_ID\",\"app-id\" : \"<>\",g" ${MANIFEST_PATH} - > sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/$PROJECT_NAME\",\"branch\" : \"<>\"\,,g" ${MANIFEST_PATH} - > sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/\",\"path\" : \".\",g" ${MANIFEST_PATH} # Adjust the manifest to HEAD - sed -i "s,<>,$APPID,g" ${MANIFEST_PATH} - sed -i "s,<>,origin/$CI_COMMIT_REF_NAME,g" ${MANIFEST_PATH} # Update the icon name - mv data/icons/hicolor/scalable/apps/$OLD_APPID.svg data/icons/hicolor/scalable/apps/$APPID.svg - mv data/icons/hicolor/symbolic/apps/$OLD_APPID-symbolic.svg data/icons/hicolor/symbolic/apps/$APPID-symbolic.svg - flatpak-builder --bundle-sources --repo=devel build ${MANIFEST_PATH} - flatpak build-bundle devel ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APPID} cache: paths: - .flatpak-builder/cache when: manual except: - tags - gnome-3-.* - master@GNOME/gnome-control-center # Runs the sanitizers [address, thread, undefined, and memory]. .sanitizer: &sanitizer <<: *save_build_logs stage: manual when: manual script: - *environment_information - *build_procedure - *run_tests except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ asan: <<: *sanitizer # ASAN requires debugging capabilities tags: [ privileged ] stage: manual when: manual variables: BUILD_OPTS: "-Db_sanitize=address" LSAN_OPTIONS: "suppressions=${CI_PROJECT_DIR}/build-aux/ci/lsan.supp" tsan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=thread" ubsan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=undefined" msan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=memory" CC: "clang" ############################################# # Create CI Docker Images # ############################################# # See also https://gitlab.freedesktop.org/freedesktop/ci-templates container_fedora_build: tags: [ privileged ] extends: .fdo.container-build@fedora # The templates reference the local registry, but we need the fdo one image: registry.freedesktop.org/freedesktop/ci-templates/buildah:2020-03-24 only: variables: - $CI_PIPELINE_SOURCE == "schedule" && $CRON_TASK == "BUILD_CI_IMAGES" variables: GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image FDO_FORCE_REBUILD: 1 # Force rebuilding the image FDO_DISTRIBUTION_PACKAGES: $FEDORA_DEPENDENCIES FDO_DISTRIBUTION_EXEC: | git clone https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git && \ cd gsettings-desktop-schemas && \ meson . _build --prefix=/usr && \ ninja -C _build && \ ninja -C _build install && \ cd ..