summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-07-08 16:01:23 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-08-22 21:27:35 +0200
commit99e368da7dcecdadb7d07ceb4c0bd250be4b181a (patch)
tree779072b8ad3f08f1d16ffc0c7965639973f0d7e8
parent1d2365630d08f00b2ede718cc145309979ef0707 (diff)
downloadmutter-wip/carlosg/code-style-checks.tar.gz
ci: Add job to check code stylewip/carlosg/code-style-checks
At the moment, allow the task to fail, while we smooth out the uncrustify configuration.
-rw-r--r--.gitlab-ci.yml23
1 files changed, 21 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 507444d90..697c71f05 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,7 @@ include:
stages:
- review
- prepare
+ - code-review
- build
- test
- analyze
@@ -15,8 +16,8 @@ variables:
.mutter.fedora:34@common:
variables:
FDO_DISTRIBUTION_VERSION: 34
- BASE_TAG: '2021-08-01.0'
- FDO_DISTRIBUTION_PACKAGES: 'gdm gnome-shell xorg-x11-server-Xvfb sassc gcovr clang'
+ BASE_TAG: '2021-08-22.0'
+ FDO_DISTRIBUTION_PACKAGES: 'gdm gnome-shell xorg-x11-server-Xvfb sassc gcovr clang uncrustify'
FDO_DISTRIBUTION_EXEC: |
dnf install -y 'dnf-command(builddep)' &&
@@ -140,6 +141,24 @@ build-fedora-container@aarch64:
variables:
GIT_STRATEGY: none
+check-code-style:
+ extends:
+ - .fdo.distribution-image@fedora
+ - .mutter.fedora:34@x86_64
+ stage: code-review
+ needs:
+ - build-fedora-container@x86_64
+ script:
+ - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+ then
+ git fetch origin master;
+ export common_parent_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent HEAD) | head -1) ;
+ python3 -u ./check-style.py --dry-run --sha $common_parent_sha ;
+ else
+ echo "Not a merge request" ;
+ fi
+ allow_failure: true
+
.build-mutter:
extends:
- .fdo.distribution-image@fedora