CI: Add deviceinfo linting via dint
Needs https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2679 to run locally. Tested and works locally with 'pmbootstrap ci' as well as in GitLab CI. Closes https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2583 Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7006>
This commit is contained in:
parent
17fcf091b2
commit
aa74915a68
3 changed files with 44 additions and 0 deletions
13
.ci/dint.sh
Executable file
13
.ci/dint.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh -e
|
||||
# Description: Validate and lint deviceinfo files
|
||||
# Options: with-dot-git
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk add git python3
|
||||
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/master
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
.ci/lib/deviceinfo_linting.py
|
||||
18
.ci/lib/deviceinfo_linting.py
Executable file
18
.ci/lib/deviceinfo_linting.py
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright 2025 Stefan Hansson
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import common
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
common.add_upstream_git_remote()
|
||||
deviceinfo_files = {file for file in common.get_changed_files(removed=False)
|
||||
if os.path.basename(file) == "deviceinfo"}
|
||||
|
||||
try:
|
||||
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)
|
||||
except subprocess.CalledProcessError as exception:
|
||||
sys.exit(exception.returncode)
|
||||
|
|
@ -101,6 +101,19 @@ aport-lint:
|
|||
- .ci/apkbuild-lint.sh
|
||||
allow_failure: true
|
||||
|
||||
# deviceinfo linting
|
||||
dint:
|
||||
stage: lint
|
||||
rules:
|
||||
- if: *mr_rule
|
||||
changes:
|
||||
- .ci/**/*
|
||||
- .gitlab-ci.yml
|
||||
- device/*/device-*/deviceinfo
|
||||
script:
|
||||
- .ci/lib/gitlab_prepare_ci.sh
|
||||
- .ci/dint.sh
|
||||
|
||||
# kernel kconfig check
|
||||
kernel-kconfig:
|
||||
stage: lint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue