Skip to content
Snippets Groups Projects
Verified Commit d932f7a3 authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

ci: enable systemd repo build testing

This creates an additional `*-systemd` build job for each CPU arch, so now there are two jobs for each arch:

1) The original build job: build changed aports with pmb systemd config set to default
2) The new '*-systemd' job: build changes aports with pmb systemd config set to 'always'

In the first job, build_changed_aports uses pmb to figure out if it
can build the changed aport(s), so that it can skip any changed aports
that are in extra-repos/systemd (these would trigger a pmb failure if
it tried)

In the second job, kernel packages are skipped since we do not want to
rebuild these, it makes no sense to rebuild them in the context of the
systemd repo when the first build job will handle build testing them.
parent 606d69fc
No related branches found
No related tags found
No related merge requests found
Pipeline #203961 passed
......@@ -2,6 +2,7 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import os
import pathlib
# Same dir
......@@ -9,6 +10,7 @@ import common
# pmbootstrap
import add_pmbootstrap_to_import_path
import pmb.core
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
......@@ -46,6 +48,12 @@ if __name__ == "__main__":
sys.exit(1)
arch = sys.argv[1]
# Are we build testing with the systemd repo enabled?
systemd = bool(os.environ.get("PMBOOTSTRAP_SYSTEMD"))
if systemd:
common.run_pmbootstrap(["config", "systemd", "always"])
print(f"extra-repos/systemd enabled: {systemd}")
# Get and print modified packages
common.add_upstream_git_remote()
packages = common.get_changed_packages()
......@@ -66,9 +74,23 @@ if __name__ == "__main__":
args = pmb.parse.arguments()
context = get_context()
# Get set of all buildable packages for the enabled repos, for skipping unbuildable
# aports later.
buildable_pkgs = set(pmb.core.pkgrepo.pkgrepo_iter_package_dirs())
# Filter out packages that can't be built for given arch
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
if systemd and package.startswith("linux-"):
print(f"{package}: build testing in systemd repo but this is a kernel package, skipping")
packages.remove(package)
continue
if package not in buildable_pkgs:
print(f"{package}: not in any available repos, skipping")
packages.remove(package)
continue
apkbuild_path = pmb.helpers.pmaports.find(package)
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
......
......@@ -145,31 +145,61 @@ build-x86_64:
script:
- .ci/build-x86_64.sh
build-x86_64-systemd:
extends: build-x86_64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-x86:
extends: .build
script:
- .ci/build-x86.sh
build-x86-systemd:
extends: build-x86
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-aarch64:
extends: .build
script:
- .ci/build-aarch64.sh
build-aarch64-systemd:
extends: build-aarch64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-armv7:
extends: .build
script:
- .ci/build-armv7.sh
build-armv7-systemd:
extends: build-armv7
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-armhf:
extends: .build
script:
- .ci/build-armhf.sh
build-armhf-systemd:
extends: build-armhf
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-riscv64:
extends: .build
script:
- .ci/build-riscv64.sh
build-riscv64-systemd:
extends: build-riscv64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
auto-update:
stage: autoupdate
rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment