CI: verify sources when ci:skip-build (!371)
Instead of simply skipping the build check, when ci:skip-build is in the last commit message (in brackets), download the sources and verify their checksums. Depends: pmbootstrap!1788
This commit is contained in:
parent
a31cc23571
commit
21852b3cc6
1 changed files with 16 additions and 11 deletions
|
@ -32,7 +32,7 @@ def run_pmbootstrap(parameters):
|
||||||
process = subprocess.Popen(cmd)
|
process = subprocess.Popen(cmd)
|
||||||
process.communicate()
|
process.communicate()
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
print("** Building failed")
|
print("** Test failed")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,11 +114,16 @@ def get_changed_packages():
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def check_build(packages):
|
def check_build(packages, verify_only=False):
|
||||||
# Initialize build environment with less logging
|
# Initialize build environment with less logging
|
||||||
run_pmbootstrap(["build_init"])
|
run_pmbootstrap(["build_init"])
|
||||||
run_pmbootstrap(["--details-to-stdout", "build", "--strict", "--force"] +
|
|
||||||
|
if verify_only:
|
||||||
|
run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
|
||||||
list(packages))
|
list(packages))
|
||||||
|
else:
|
||||||
|
run_pmbootstrap(["--details-to-stdout", "build", "--strict",
|
||||||
|
"--force"] + list(packages))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -130,15 +135,15 @@ if __name__ == "__main__":
|
||||||
# Get and print modified packages
|
# Get and print modified packages
|
||||||
packages = get_changed_packages()
|
packages = get_changed_packages()
|
||||||
|
|
||||||
# Stop here if desired
|
|
||||||
if commit_message_has_string("[ci:skip-build]"):
|
|
||||||
print("WARNING: not building changed packages ([ci:skip-build])!")
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
# Build changed packages
|
# Build changed packages
|
||||||
get_changed_packages_sanity_check(len(packages))
|
get_changed_packages_sanity_check(len(packages))
|
||||||
if len(packages) == 0:
|
if len(packages) == 0:
|
||||||
print("no aports changed in this branch")
|
print("no aports changed in this branch")
|
||||||
|
else:
|
||||||
|
verify_only = commit_message_has_string("[ci:skip-build]")
|
||||||
|
if verify_only:
|
||||||
|
print("WARNING: not building changed packages ([ci:skip-build])!")
|
||||||
|
print("verifying checksums: " + ", ".join(packages))
|
||||||
else:
|
else:
|
||||||
print("building in strict mode: " + ", ".join(packages))
|
print("building in strict mode: " + ", ".join(packages))
|
||||||
check_build(packages)
|
check_build(packages, verify_only)
|
||||||
|
|
Loading…
Reference in a new issue