From: Daniel Gomez <da.gomez@kernel.org>
To: kdevops@lists.linux.dev, Luis Chamberlain <mcgrof@kernel.org>
Cc: Daniel Gomez <da.gomez@samsung.com>, Daniel Gomez <da.gomez@kernel.org>
Subject: [PATCH] ci: add CI_WORKFLOW parameter
Date: Mon, 12 May 2025 16:15:50 +0200 [thread overview]
Message-ID: <20250512-ci-workflow-v1-1-9ae199d83ebe@samsung.com> (raw)
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>
next reply other threads:[~2025-05-12 14:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 14:15 Daniel Gomez [this message]
2025-05-14 18:30 ` [PATCH] ci: add CI_WORKFLOW parameter Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250512-ci-workflow-v1-1-9ae199d83ebe@samsung.com \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox