image: registry.gitlab.gnome.org/gnome/gnome-settings-daemon:fedora.dev stages: - build - test - manual - delivery .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 when: always 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} && 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 Settings Daemon 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 - | if [[ -n "${CI_COMMIT_TAG}" ]]; then *run_tests echo "== Distro Test ==" ninja dist -C _build else echo "== Testing ==" meson test -C _build --verbose --no-stdsplit fi except: variables: - $CI_PIPELINE_SOURCE == "schedule" - $CI_COMMIT_TITLE =~ /^Update.*translation$/ # Runs the coverage test. coverage: <<: *save_build_logs stage: test # Appears to be broken on Fedora Rawhide as of 2018-02-05 allow_failure: true variables: BUILD_OPTS: "-Db_coverage=true" coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/' only: - master@GNOME/gnome-settings-daemon 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 ## # Stage: Delivery # # Publishes the Coverage Report generated above ## pages: stage: delivery # Don't error in case coverage failed allow_failure: true dependencies: - coverage script: - mv _build/meson-logs/coveragereport/ public/ artifacts: paths: - public only: - master@GNOME/gnome-settings-daemon ## # Stage: Manual # # 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 variables: BUILD_OPTS: "-Db_sanitize=address" tsan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=thread" ubsan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=undefined" msan: <<: *sanitizer variables: BUILD_OPTS: "-Db_sanitize=memory -Db_lundef=false" CC: "clang" ############################################# # Create CI Docker Images # ############################################# .Docker image template: &create_docker_image image: docker:latest stage: delivery services: - docker:dind only: variables: - $CRON_TASK == "BUILD_CI_IMAGES" script: # Skip the build (if requested) - | if [[ -z "${CI_COMMIT_MESSAGE##*'[skip images]'*}" ]]; then echo "== Nothing to do ==" exit 0 fi # Get multiarch stuff - | if [[ -n "${TARGET_ARCH}" ]]; then docker run --rm --privileged multiarch/qemu-user-static:register --reset wget https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/x86_64_qemu-${TARGET_ARCH}-static.tar.gz fi # Build using the Dockerfile - docker build -f "$DOCKERFILE" -t "$CI_REGISTRY_IMAGE:$NAME" . # Prepare to publish - docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_$NAME" - docker images - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} # Publish (if running on a schedule) - | if [[ "${CI_PIPELINE_SOURCE}" == "schedule" ]]; then docker push "$CI_REGISTRY_IMAGE" fi fedora.dev: <<: *create_docker_image variables: DOCKER_DRIVER: overlay DOCKERFILE: "build-aux/ci/Dockerfile.fedora.rawhide" NAME: "fedora.dev" fedora.aarch64: <<: *create_docker_image variables: DOCKER_DRIVER: overlay DOCKERFILE: "build-aux/ci/Dockerfile.arm64v8.fedora.rawhide" NAME: "fedora.aarch64" TARGET_ARCH: "aarch64" fedora.ppc64le: <<: *create_docker_image variables: DOCKER_DRIVER: overlay DOCKERFILE: "build-aux/ci/Dockerfile.ppc64le.fedora.rawhide" NAME: "fedora.ppc64le" TARGET_ARCH: "ppc64le"