diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2023-02-16 00:30:15 -0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-02-24 00:22:19 +0000 |
commit | 5586511446a9988af7b5e19b61c151b5d1111691 (patch) | |
tree | acc629bcc3a1473ca846c3c0283983ef2b2fc27b /.gitlab-ci.yml | |
parent | fb076db1b2a48f7e07bc851c4d4f72a3d269a109 (diff) | |
download | gstreamer-5586511446a9988af7b5e19b61c151b5d1111691.tar.gz |
ci: Add a job to verify commit messages on MRs
This uses [gitlint] and is based on their linting rules with some minor
config so it matches our style pretty well.
[gitlint]: https://jorisroovers.com/gitlint/#configuration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3980>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7caa885074..22f153ab0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,6 +34,7 @@ variables: FEDORA_AMD64_SUFFIX: 'amd64/fedora' INDENT_AMD64_SUFFIX: 'amd64/gst-indent' + COMMITLINT_AMD64_SUFFIX: 'amd64/commitlint' WINDOWS_AMD64_SUFFIX: 'amd64/windows' WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH" @@ -154,6 +155,22 @@ gst-indent amd64 docker: # Do not depend on the trigger, as we want to run indent always needs: [] +.commitlint image: + variables: + FDO_DISTRIBUTION_VERSION: '37' + FDO_REPO_SUFFIX: "$COMMITLINT_AMD64_SUFFIX" + FDO_DISTRIBUTION_TAG: "$LINT_TAG-$GST_UPSTREAM_BRANCH" + FDO_DISTRIBUTION_PACKAGES: 'python3-pip git' + FDO_DISTRIBUTION_EXEC: 'ci/docker/lint/prepare.sh' + +commitlint docker: + extends: + - '.commitlint image' + - '.fdo.container-build@fedora' + stage: 'preparation' + # Do not depend on the trigger, as we want to run indent always + needs: [] + windows amd64 docker: stage: "preparation" needs: @@ -205,6 +222,25 @@ gst indent: - if: '$CI_PROJECT_NAMESPACE != "gstreamer" || $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH' when: 'always' +commitlint: + extends: + - '.commitlint image' + - '.fdo.suffixed-image@fedora' + stage: 'preparation' + variables: + GIT_STRATEGY: fetch + GIT_DEPTH: 100 + needs: + - job: 'commitlint docker' + artifacts: false + script: + - echo $CI_MERGE_REQUEST_DIFF_BASE_SHA + - gitlint --commits $CI_MERGE_REQUEST_DIFF_BASE_SHA..HEAD + rules: + # Only run on MR as we need CI_MERGE_REQUEST_DIFF_BASE_SHA to know + # what commits to check + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + # # build setup templates # |