* [PATCH] ci: add CI_WORKFLOW parameter
@ 2025-05-12 14:15 Daniel Gomez
2025-05-14 18:30 ` Luis Chamberlain
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Gomez @ 2025-05-12 14:15 UTC (permalink / raw)
To: kdevops, Luis Chamberlain; +Cc: Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
A typical kdevops CI workflow includes:
make defconfig-<repository>
make
make bringup
make linux
make ci-build-test
make ci-test
make ci-results
make destroy
These ci-* targets internally run specific Makefile targets such as
selftest (for ci-build-test) or selftests-baseline / fstests-baseline
(for ci-test), depending on the repository name.
This change adds the CI_WORKFLOW Makefile variable to allow customizing
the CI workflow when the repository name alone is not sufficient, for
example, to support multiple workflows within the same repository.
Rename BOOTLINUX_BASELINE_BASENAME to the CI_WORKFLOW_BASENAME to better
describe the purpose of the string.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
scripts/ci.Makefile | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/scripts/ci.Makefile b/scripts/ci.Makefile
index ffb83f9369b0321eaab2193d4c29113710e8a643..164e72ee8c7abf4e384f003a6d6f01251287bb54 100644
--- a/scripts/ci.Makefile
+++ b/scripts/ci.Makefile
@@ -2,13 +2,20 @@
# Collection of CI build targets per kernel repo
+CI_WORKFLOW ?= ""
ifeq (y,$(CONFIG_BOOTLINUX))
-BOOTLINUX_BASENAME := $(shell basename $(CONFIG_BOOTLINUX_TREE) | sed 's/\.git$$//')
-ifneq ($(wildcard .ci/build-test/$(BOOTLINUX_BASENAME)),)
-ifneq ($(wildcard .ci/test/$(BOOTLINUX_BASENAME)),)
-ifneq ($(wildcard .ci/results/$(BOOTLINUX_BASENAME)),)
-ci-build-test: ci-build-test-$(BOOTLINUX_BASENAME)
+ifeq ($(strip $(CI_WORKFLOW)),)
+CI_WORKFLOW_BASENAME := $(shell basename $(CONFIG_BOOTLINUX_TREE) | sed 's/\.git$$//')
+else
+CI_WORKFLOW_BASENAME := $(shell basename $(CI_WORKFLOW))
+endif
+
+ifneq ($(wildcard .ci/build-test/$(CI_WORKFLOW_BASENAME)),)
+ifneq ($(wildcard .ci/test/$(CI_WORKFLOW_BASENAME)),)
+ifneq ($(wildcard .ci/results/$(CI_WORKFLOW_BASENAME)),)
+
+ci-build-test: ci-build-test-$(CI_WORKFLOW_BASENAME)
PHONY += build-test
@@ -17,51 +24,51 @@ ci-build-test-%::
while IFS= read -r line || [ -n "$$line" ]; do \
echo "Running: $$line"; \
$$line; \
- done < .ci/build-test/$(BOOTLINUX_BASENAME); \
+ done < .ci/build-test/$(CI_WORKFLOW_BASENAME); \
ci-build-test-help-menu:
- @echo "kdevops built-in CI build tests for $(BOOTLINUX_BASENAME):"
+ @echo "kdevops built-in CI build tests for $(CI_WORKFLOW_BASENAME):"
@echo "ci-build-test - Git clones a linux git tree, build Linux, installs and reboots into it"
@while IFS= read -r line || [ -n "$$line" ]; do \
echo -e "\t$$line"; \
- done < .ci/build-test/$(BOOTLINUX_BASENAME)
+ done < .ci/build-test/$(CI_WORKFLOW_BASENAME)
@echo
HELP_TARGETS += ci-build-test-help-menu
-ci-test: ci-test-$(BOOTLINUX_BASENAME)
+ci-test: ci-test-$(CI_WORKFLOW_BASENAME)
ci-test-%::
@set -e; \
while IFS= read -r line || [ -n "$$line" ]; do \
echo "Running: $$line"; \
$$line; \
- done < .ci/test/$(BOOTLINUX_BASENAME); \
+ done < .ci/test/$(CI_WORKFLOW_BASENAME); \
ci-test-help-menu:
- @echo "kdevops built-in run time tests for $(BOOTLINUX_BASENAME):"
+ @echo "kdevops built-in run time tests for $(CI_WORKFLOW_BASENAME):"
@echo "ci-test - Git clones a linux git tree, build Linux, installs and reboots into it"
@while IFS= read -r line || [ -n "$$line" ]; do \
echo -e "\t$$line"; \
- done < .ci/test/$(BOOTLINUX_BASENAME)
+ done < .ci/test/$(CI_WORKFLOW_BASENAME)
@echo
HELP_TARGETS += ci-test-help-menu
-ci-results: ci-results-$(BOOTLINUX_BASENAME)
+ci-results: ci-results-$(CI_WORKFLOW_BASENAME)
ci-results-%::
@set -e; \
while IFS= read -r line || [ -n "$$line" ]; do \
echo -e "$$line"; \
- done < .ci/results/$(BOOTLINUX_BASENAME)
+ done < .ci/results/$(CI_WORKFLOW_BASENAME)
ci-results-help-menu:
- @echo "kdevops built-in results tests for $(BOOTLINUX_BASENAME) can be found in directories:"
+ @echo "kdevops built-in results tests for $(CI_WORKFLOW_BASENAME) can be found in directories:"
@echo "ci-results - List of directories where you can find test results"
@while IFS= read -r line || [ -n "$$line" ]; do \
echo -e "\t$$line"; \
- done < .ci/results/$(BOOTLINUX_BASENAME)
+ done < .ci/results/$(CI_WORKFLOW_BASENAME)
@echo
HELP_TARGETS += ci-results-help-menu
---
base-commit: ef549598f2261ac89643d3e7a8ea0f050fc27c5f
change-id: 20250512-ci-workflow-6867b6759b0a
Best regards,
--
Daniel Gomez <da.gomez@samsung.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ci: add CI_WORKFLOW parameter
2025-05-12 14:15 [PATCH] ci: add CI_WORKFLOW parameter Daniel Gomez
@ 2025-05-14 18:30 ` Luis Chamberlain
0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2025-05-14 18:30 UTC (permalink / raw)
To: Daniel Gomez; +Cc: kdevops, Daniel Gomez
On Mon, May 12, 2025 at 04:15:50PM +0200, Daniel Gomez wrote:
> From: Daniel Gomez <da.gomez@samsung.com>
>
> A typical kdevops CI workflow includes:
>
> make defconfig-<repository>
> make
> make bringup
> make linux
> make ci-build-test
> make ci-test
> make ci-results
> make destroy
>
> These ci-* targets internally run specific Makefile targets such as
> selftest (for ci-build-test) or selftests-baseline / fstests-baseline
> (for ci-test), depending on the repository name.
>
> This change adds the CI_WORKFLOW Makefile variable to allow customizing
> the CI workflow when the repository name alone is not sufficient, for
> example, to support multiple workflows within the same repository.
>
> Rename BOOTLINUX_BASELINE_BASENAME to the CI_WORKFLOW_BASENAME to better
> describe the purpose of the string.
>
> Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-14 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 14:15 [PATCH] ci: add CI_WORKFLOW parameter Daniel Gomez
2025-05-14 18:30 ` Luis Chamberlain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox