From f0c58518cc87bb492c2f8b184974b9d8ad6f966d Mon Sep 17 00:00:00 2001 From: Sergi Blanch-Torne Date: Mon, 30 Jun 2025 10:48:34 +0200 Subject: [PATCH] ci: reduce the root .gitlab-ci file Following the idea to distribute in a tree of files to include and split between the files with or without hidden job definitions, some jobs in the root file can be moved to files made specific to describe build or test jobs. Signed-off-by: Sergi Blanch-Torne Part-of: --- .gitlab-ci.yml | 60 ------------------------------ .gitlab-ci/build/gitlab-ci-inc.yml | 13 +++++++ .gitlab-ci/build/gitlab-ci.yml | 18 +++++++++ .gitlab-ci/test/gitlab-ci-inc.yml | 10 +++++ .gitlab-ci/test/gitlab-ci.yml | 18 +++++++++ 5 files changed, 59 insertions(+), 60 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e58dbb3ce6..9a309b791c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -387,38 +387,6 @@ include: # manually triggered - when: manual - -.ci-deqp-artifacts: - artifacts: - name: "${CI_PROJECT_NAME}_${CI_JOB_NAME_SLUG}" - when: always - untracked: false - paths: - # Watch out! Artifacts are relative to the build dir. - # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521 - - artifacts - - _build/meson-logs/*.txt - - _build/meson-logs/strace - - _build/.ninja_log - -# Git archive - -make-git-archive: - extends: - - .fdo.ci-fairy - stage: git-archive - rules: - - !reference [.scheduled_pipeline-rules, rules] - script: - # Compactify the .git directory - - git gc --aggressive - # Download & cache the perfetto subproject as well. - - rm -rf subprojects/perfetto ; mkdir -p subprojects/perfetto && curl --fail https://android.googlesource.com/platform/external/perfetto/+archive/$(grep 'revision =' subprojects/perfetto.wrap | cut -d ' ' -f3).tar.gz | tar zxf - -C subprojects/perfetto - # compress the current folder - - tar -cvzf ../$CI_PROJECT_NAME.tar.gz . - - - ci-fairy s3cp --token-file "${S3_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz - # Sanity checks of MR settings and commit logs sanity: extends: @@ -467,31 +435,3 @@ sanity: reports: junit: check-*.xml - -mr-label-maker-test: - extends: - - .fdo.ci-fairy - stage: sanity - tags: - - placeholder-job - rules: - - !reference [.mr-label-maker-rules, rules] - variables: - GIT_STRATEGY: fetch - timeout: 10m - script: - - set -eu - - python3 -m venv .venv - - source .venv/bin/activate - - pip install git+https://gitlab.freedesktop.org/freedesktop/mr-label-maker - - mr-label-maker --dry-run --mr $CI_MERGE_REQUEST_IID - -# Jobs that need to pass before spending hardware resources on further testing -.required-for-hardware-jobs: - needs: - - job: rustfmt - optional: true - artifacts: false - - job: yaml-toml-shell-py-test - optional: true - artifacts: false diff --git a/.gitlab-ci/build/gitlab-ci-inc.yml b/.gitlab-ci/build/gitlab-ci-inc.yml index 560a3a4ca41..16b7bbd4257 100644 --- a/.gitlab-ci/build/gitlab-ci-inc.yml +++ b/.gitlab-ci/build/gitlab-ci-inc.yml @@ -81,3 +81,16 @@ paths: - subprojects/packagecache +.ci-deqp-artifacts: + artifacts: + name: "${CI_PROJECT_NAME}_${CI_JOB_NAME_SLUG}" + when: always + untracked: false + paths: + # Watch out! Artifacts are relative to the build dir. + # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521 + - artifacts + - _build/meson-logs/*.txt + - _build/meson-logs/strace + - _build/.ninja_log + diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index 5bfd09cf648..4aa2d58559e 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -1,6 +1,24 @@ include: - local: '.gitlab-ci/build/gitlab-ci-inc.yml' +# Git archive + +make-git-archive: + extends: + - .fdo.ci-fairy + stage: git-archive + rules: + - !reference [.scheduled_pipeline-rules, rules] + script: + # Compactify the .git directory + - git gc --aggressive + # Download & cache the perfetto subproject as well. + - rm -rf subprojects/perfetto ; mkdir -p subprojects/perfetto && curl --fail https://android.googlesource.com/platform/external/perfetto/+archive/$(grep 'revision =' subprojects/perfetto.wrap | cut -d ' ' -f3).tar.gz | tar zxf - -C subprojects/perfetto + # compress the current folder + - tar -cvzf ../$CI_PROJECT_NAME.tar.gz . + + - ci-fairy s3cp --token-file "${S3_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz + debian-x86_64: extends: - .meson-build-for-tests diff --git a/.gitlab-ci/test/gitlab-ci-inc.yml b/.gitlab-ci/test/gitlab-ci-inc.yml index 04d572e0888..d6e204d3ffa 100644 --- a/.gitlab-ci/test/gitlab-ci-inc.yml +++ b/.gitlab-ci/test/gitlab-ci-inc.yml @@ -182,3 +182,13 @@ - (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst | tar --zstd -x) - section_end artifacts_download +# Jobs that need to pass before spending hardware resources on further testing +.required-for-hardware-jobs: + needs: + - job: rustfmt + optional: true + artifacts: false + - job: yaml-toml-shell-py-test + optional: true + artifacts: false + diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml index ed8a335ea2a..d6f770f69c6 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -1,6 +1,24 @@ include: - local: '.gitlab-ci/test/gitlab-ci-inc.yml' +mr-label-maker-test: + extends: + - .fdo.ci-fairy + stage: sanity + tags: + - placeholder-job + rules: + - !reference [.mr-label-maker-rules, rules] + variables: + GIT_STRATEGY: fetch + timeout: 10m + script: + - set -eu + - python3 -m venv .venv + - source .venv/bin/activate + - pip install git+https://gitlab.freedesktop.org/freedesktop/mr-label-maker + - mr-label-maker --dry-run --mr $CI_MERGE_REQUEST_IID + rustfmt: extends: - .formatting-check