diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9351525..22d3274 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ include: - 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml' - 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml' - project: 'guidog/meta-phosh' - ref: '2aeb9bfe2b230ca3aeda8275e42c95f94f6723ca' + ref: 'eb1c7f3c602f93e50ba0f1b7da31c936c771a75c' file: '/ci/phosh-common-jobs.yml' - component: "gitlab.gnome.org/GNOME/citemplates/release-service@master" inputs: @@ -13,6 +13,7 @@ include: stages: - build - test + - style-checks - package - test-package - deploy @@ -101,6 +102,11 @@ check-consistency: stage: test extends: .phosh-check-consistency +check-meson: + stage: style-checks + extends: + - .phosh-check-meson + package:deb-debian-trixie:arm64: variables: L5_DOCKER_IMAGE: debian:trixie diff --git a/.gitlab-ci/check-meson b/.gitlab-ci/check-meson new file mode 100755 index 0000000..5a9c5f0 --- /dev/null +++ b/.gitlab-ci/check-meson @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Copyright (C) 2025 The Phosh developers +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# Author: Guido Günther + +ret=0 + +TMPDIR=$(mktemp -d) + +# We check files individually so we can print the diff: +while IFS= read -r -d '' file; do + if ! meson format -e --check-only "$file"; then + echo + echo "Meson file '${file}' needs reformat:" + meson format -e "$file" > "${TMPDIR}/meson.build" + diff -u "$file" "${TMPDIR}/meson.build" + rm -f "${TMPDIR}/meson.build" + ret=1 + fi +done < <(find . -name '*.build' -not -path './subprojects/*' -print0) + +if [ -n "$TMPDIR" ]; then + rmdir "${TMPDIR}" +fi + +if [ $ret -ne 0 ]; then + cat <