include: - project: Infrastructure/freedesktop-ci-templates file: templates/fedora.yml ref: 765bb77a5e1274b0daeb14344e7caa6cd3876232 - component: gitlab.gnome.org/GNOME/citemplates/release-service@master inputs: dist-job-name: release-build tarball-artifact-path: $TARBALL_ARTIFACT_PATH variables: FDO_UPSTREAM_REPO: gnome/gnome-control-center MESON_BUILD_DIR: _build TARBALL_ARTIFACT_PATH: "$MESON_BUILD_DIR/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz" stages: - prepare - build - test - manual - deploy .Build Logs: &build_logs name: build_logs when: always paths: - ./*.log - $MESON_BUILD_DIR/meson-logs/ .Build Output: &build_output artifacts: name: build_output when: always paths: - ./*.log - $MESON_BUILD_DIR/ 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 ==" && meson setup $MESON_BUILD_DIR ${BUILD_OPTS} -Dprofile=development -Dwarning_level=2 && meson compile -C $MESON_BUILD_DIR 2>&1 | tee compilation.log .Run Tests: &run_tests export GSK_RENDERER=ngl && echo "== Testing ==" && meson test -C $MESON_BUILD_DIR --verbose --no-stdsplit --no-rebuild .fedora.container.common: variables: # When branching a stable release, change 'main' to the # release branch name to ensure that a new image will # be created, tailored for the stable branch. # Should probably also switch away from 'rawhide', # to stable fedora branch as well. BRANCH_NAME: 'gnome-48' CONTAINER_TAG: '2025-05-20.0' FEDORA_VERSION: 42 # Derive FDO variables from this automatically. # DO NOT edit, instead change the variables above FDO_REPO_SUFFIX: '${BRANCH_NAME}' FDO_DISTRIBUTION_TAG: '${CONTAINER_TAG}-fedora-${FEDORA_VERSION}' FDO_DISTRIBUTION_VERSION: '${FEDORA_VERSION}' ############################################# # Create CI Docker Images # ############################################# # See also https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates build.container.fedora@x86_64: extends: - '.fdo.container-build@fedora' - '.fedora.container.common' stage: 'prepare' variables: # no need to pull the whole tree for rebuilding the image GIT_STRATEGY: none # Expiry sets fdo.expires on the image FDO_EXPIRES_AFTER: 8w # NOTES: # - most packages are needed for testing # - glibc-langpack-en is needed for sorting in run-style-check-diff.sh # - libsass-devel, sassc are often needed for building libadwaita, gtk, etc. FDO_DISTRIBUTION_PACKAGES: >- dnf5-plugins gawk git llvm clang libasan libtsan libubsan compiler-rt gcovr meson clang-tools-extra glibc-langpack-en python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsass-devel sassc FDO_DISTRIBUTION_EXEC: |- dnf builddep -y gnome-control-center && \ dnf remove -y systemtap-runtime ## # 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: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' stage: build script: - *environment_information - *build_procedure - echo "== Installing ==" - meson install -C $MESON_BUILD_DIR - echo "== Report ==" - build-aux/ci/ci-helper.sh "WARNINGS" <<: *build_output except: variables: - $CI_PIPELINE_SOURCE == "schedule" # Same as build but with various off-by-default options enabled conditional builds: extends: - build artifacts: # Only save build logs for these <<: *build_logs parallel: matrix: - BUILD_OPTS: '-Dmalcontent=true' - BUILD_OPTS: '-Ddocumentation=true' ## # Stage: Test # # Runs static checks. # Runs the unit tests. ## style-check-diff: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' needs: - build.container.fedora@x86_64 stage: test when: always allow_failure: true script: - .gitlab-ci/run-style-check-diff.sh check-potfiles: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' needs: - build.container.fedora@x86_64 stage: test when: always variables: GIT_SUBMODULE_STRATEGY: normal script: - .gitlab-ci/check-potfiles.sh test: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' stage: test needs: - build script: - *environment_information - *run_tests artifacts: <<: *build_logs reports: junit: '$MESON_BUILD_DIR/meson-logs/testlog.junit.xml' except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ release-build: stage: build extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' script: - meson subprojects download gvc libgxdp - meson setup $MESON_BUILD_DIR --wrap-mode=nodownload - meson dist -C $MESON_BUILD_DIR --no-tests --include-subprojects artifacts: paths: - $TARBALL_ARTIFACT_PATH # Runs the coverage test. coverage: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' dependencies: - build.container.fedora@x86_64 stage: test variables: BUILD_OPTS: "-Db_coverage=true" coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/' only: - main@GNOME/gnome-control-center script: - *environment_information - *build_procedure - *run_tests - ninja -C $MESON_BUILD_DIR coverage-html # Parse the report to get the coverage result - | echo == Coverage == sed -e 's/<[^>]*>//g' $MESON_BUILD_DIR/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo artifacts: <<: *build_logs except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ ## # Stage: Deploy # # Publishes release artifacts and the Coverage Report generated above ## pages: extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' stage: deploy dependencies: - coverage script: - mv $MESON_BUILD_DIR/meson-logs/coveragereport/ public/ artifacts: paths: - public only: - main@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: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master artifacts: name: package paths: - $(pwd)/*.flatpak expire_in: 7 days variables: OLD_APPID: "org.gnome.Settings" APPID: "org.gnome.Settings.Devel" BUNDLE: "org.gnome.Settings.Devel.flatpak" MANIFEST_PATH: "build-aux/flatpak/org.gnome.Settings.Devel.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 ==" # 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 --disable-rofiles-fuse --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-.* - main@GNOME/gnome-control-center # Runs the sanitizers [address, thread, undefined, and memory]. .sanitizer: &sanitizer extends: - '.fdo.suffixed-image@fedora' - '.fedora.container.common' dependencies: - build.container.fedora@x86_64 stage: manual when: manual script: - *environment_information - *build_procedure - *run_tests artifacts: <<: *build_logs except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ asan: <<: *sanitizer # ASAN requires debugging capabilities tags: [ asan ] 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"