From feab973662d6370ddd6e3df143c0033d54a228d1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 Jul 2020 11:54:58 +0100 Subject: [PATCH 1/2] ci: Move some CI jobs from branches to schedules These jobs (`scan-build` and `valgrind`) take ages to run and rarely indicate failures, so move them to a weekly schedule, rather than running them on each branch/MR. The current schedule is once weekly: https://gitlab.gnome.org/GNOME/glib/-/pipeline_schedules. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e25d57bd9..4231eceaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,14 @@ variables: - bash .gitlab-ci/show-execution-environment.sh - cp -r $HOME/subprojects/* subprojects/ +# Some jobs take a long time and are unlikely to find failures (or will find +# failures which are not merge-blockers to fix), so they’re executed on a weekly +# schedule in order to save CI resources and speed up branch pipelines. +.build-only-schedules: + extends: .build + only: + - schedules + style-check-diff: extends: .only-default image: $DEBIAN_IMAGE @@ -123,7 +131,7 @@ debian-stable-x86_64: - "_build/${CI_JOB_NAME}-report.xml" installed-tests: - extends: .build + extends: .build-only-schedules image: $FEDORA_IMAGE stage: build script: @@ -177,7 +185,7 @@ installed-tests: - "_build/installed-tests-report/" G_DISABLE_ASSERT: - extends: .build + extends: .build-only-schedules image: $FEDORA_IMAGE stage: build script: @@ -203,7 +211,7 @@ G_DISABLE_ASSERT: - "_build/${CI_JOB_NAME}-report.xml" valgrind: - extends: .build + extends: .build-only-schedules image: $FEDORA_IMAGE stage: analysis variables: @@ -429,7 +437,7 @@ coverage: coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/' scan-build: - extends: .build + extends: .build-only-schedules image: $FEDORA_IMAGE stage: analysis script: From 410ee530b5ceb2fd2c9576e8bca11871147daca5 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 Jul 2020 12:00:57 +0100 Subject: [PATCH 2/2] ci: Add DAG attributes Add some basic DAG attributes so that some jobs in the pipeline can run out of stage order to speed things up a little. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4231eceaa..96767cb98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,6 +59,7 @@ fedora-x86_64: extends: .build image: $FEDORA_IMAGE stage: build + needs: [] variables: CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" script: @@ -106,6 +107,7 @@ debian-stable-x86_64: extends: .build image: $DEBIAN_IMAGE stage: build + needs: [] script: - meson ${MESON_COMMON_OPTIONS} --werror @@ -134,6 +136,7 @@ installed-tests: extends: .build-only-schedules image: $FEDORA_IMAGE stage: build + needs: [] script: # dtrace is disabled because it breaks the static-link.py test - meson ${MESON_COMMON_OPTIONS} @@ -188,6 +191,7 @@ G_DISABLE_ASSERT: extends: .build-only-schedules image: $FEDORA_IMAGE stage: build + needs: [] script: - meson ${MESON_COMMON_OPTIONS} --werror @@ -214,6 +218,7 @@ valgrind: extends: .build-only-schedules image: $FEDORA_IMAGE stage: analysis + needs: [] variables: MESON_TEST_TIMEOUT_MULTIPLIER: 10 script: @@ -246,6 +251,7 @@ valgrind: .cross-template: &cross-template extends: .build stage: build + needs: [] artifacts: name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" when: always @@ -283,6 +289,7 @@ msys2-mingw32: stage: build tags: - win32-ps + needs: [] variables: MSYSTEM: "MINGW32" CHERE_INVOKING: "yes" @@ -305,6 +312,7 @@ vs2017-x64: stage: build tags: - win32-ps + needs: [] script: - .gitlab-ci/test-msvc.bat artifacts: @@ -326,6 +334,7 @@ freebsd-11-x86_64: # To compile GLib, you still have to install the following packages: # desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info - freebsd-11 + needs: [] variables: # CPPFLAGS is required because libintl doesn't use pkg-config. CPPFLAGS: -I/usr/local/include @@ -363,6 +372,7 @@ freebsd-12-x86_64: - branches@GNOME/glib tags: - freebsd-12 + needs: [] variables: CPPFLAGS: -I/usr/local/include LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags @@ -393,6 +403,7 @@ macos: - branches@GNOME/glib tags: - macos + needs: [] before_script: - bash .gitlab-ci/show-execution-environment.sh - pip3 install --user meson==0.49.2 @@ -426,6 +437,7 @@ coverage: extends: .only-default image: $FEDORA_IMAGE stage: coverage + needs: ['fedora-x86_64', 'msys2-mingw32'] artifacts: name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" paths: @@ -440,6 +452,7 @@ scan-build: extends: .build-only-schedules image: $FEDORA_IMAGE stage: analysis + needs: [] script: - meson ${MESON_COMMON_OPTIONS} --werror @@ -462,6 +475,7 @@ pages: stage: deploy only: - master + needs: ['coverage', 'style-check-diff'] script: - mv _coverage/ public/ artifacts: