CI: use pmbootstrap lint for checking packages (MR 1132)

This commit is contained in:
Daniele Debernardi 2020-04-06 23:06:11 +02:00 committed by Oliver Smith
parent 233ec0d21c
commit 5ead73e86c
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 7 additions and 6 deletions

View file

@ -85,9 +85,10 @@ aports-static:
aport-lint: aport-lint:
stage: first stage: first
before_script: before_script:
- apk -q add git atools python3 - wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script: script:
- .gitlab-ci/apkbuild-linting.py - su pmos -c ".gitlab-ci/apkbuild-linting.py"
only: only:
- merge_requests - merge_requests
allow_failure: true allow_failure: true

View file

@ -3,7 +3,6 @@
import common import common
import os.path import os.path
import subprocess
import sys import sys
if __name__ == "__main__": if __name__ == "__main__":
@ -20,9 +19,10 @@ if __name__ == "__main__":
print(f"NOTE: Skipping linting of {apkbuild}") print(f"NOTE: Skipping linting of {apkbuild}")
continue continue
result = subprocess.run(["apkbuild-lint", apkbuild], capture_output=True) package = os.path.basename(os.path.dirname(apkbuild))
if len(result.stdout) > 0: result = common.run_pmbootstrap(["-q", "lint", package], output_return=True)
issues.append([apkbuild, result.stdout.decode("utf-8")]) if len(result) > 0:
issues.append([apkbuild, result])
if len(issues) > 0: if len(issues) > 0:
print("Linting issues found:") print("Linting issues found:")