-
Notifications
You must be signed in to change notification settings - Fork 877
Add self-hosted github actions checks, linting and docs #2777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minimal comments from me... I plan not being to picky and just let you experiment with all of this :)
Looks very promising!
CONFIG_IIO_TRIGGERED_BUFFER=y | ||
CONFIG_IIO_SW_DEVICE=y | ||
CONFIG_IIO_SW_TRIGGER=y | ||
CONFIG_IIO_TRIGGERED_EVENT=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are our drivers being enabled? Are we relying on defaults? Just wondering how will this grow? We also have some fair amount of HWMON drivers (and media now with all the gsml stuff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to have the DEPENDS
and if
Kconfig blocks enabled on this defconfig, and auto_set_kconfig tries to set it.
I will add more defaults to the defconfigs, since HWMOM and others are missing.
on special cases the defconfig can be manipulated by a commit, which may either be relevant only for the pr or be merged.
It is hard to discover which configs to enable based on the touched drivers, since when it is hidden by a DEPENDS
or if
block, there is no tool to enable/resolve it.
but:
scripts/config -e $conf
appends $conf to .configmake yes2modconfig
, resolves the .config, removing from .config if hidden byDEPENDS
orif
so an assert step after yes2modconfig could be inserted, and on failure, then just all ADI drivers as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to have the DEPENDS and if Kconfig blocks enabled on this defconfig, and auto_set_kconfig tries to set it.
I see, but that might be hard to track long term
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at yocto's symbol_why.py and gave a second try, resulting in ci/symbols_depend.py
it is aware of if blocks, and source and depends methods.
the complex boolean logic comes from architecture related symbols (ARCH_, CPU_, X86) and these are set by the base defconfig adi_ci_defconfig, and therefore filtered out.
if any touched .c file is not compiled the CI fails, so if the script is not good enough the assertion will catch.
this build is intended for checking/linting, and forgetting to properly set the depends on a driver is also a common mistake
.github/workflows/checks.yml
Outdated
source ci/build.sh | ||
check_coccicheck | ||
|
||
- name: DT binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did not went to deep but this bindings are running against which kernel tree? This is very sensible so I would be careful about that.
Right now we use the dt/next tree IIRC but I have been thinking about switching to Linus master branch as that is what Rob (DT maintainer) is using AFAIU and the current tree already gave us some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all checks are run at the checked out tree.
your suggestion is to checkout Linux master and checkout only the files related to the dt bindings?
in the scenario of using jic23/iio/testing, would this still be necessary?
I can Linux master to the list of fetched remotes so this can be done, (checkout linus/master -> checkout individual files -> dt_binding_check -> checkout trunk back)
I would make this a feature of a subsequent pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all checks are run at the checked out tree.
That might be hard to match dt tools against the checked tree... For instance, validating a binding file in our tree triggers a bunch of unrelated errors in other files.
your suggestion is to checkout Linux master and checkout only the files related to the dt bindings?
That's what we do today
in the scenario of using jic23/iio/testing, would this still be necessary?
We can try that one... But linus/master should be more reliable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does raise a lot of unrelated errors.
I will give it a try then, but overall opening a pr against the mirrors are also an option.
Docs intended to document non-upstream drivers and general code such as continuous integration. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Minimal defconfig to have only IIO drivers of interest enabled for CI contenxt. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Minimal defconfig to have only IIO drivers of interest enabled for CI contenxt. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Minimal defconfig to have only IIO drivers of interest enabled for CI contenxt. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Add workflow to build the documentation. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
06952b8
to
9220796
Compare
9220796
to
754d4de
Compare
The cron jobs synchronize mirrors, applying the continuous integration on top. The alternative workflows.mirror files are provided to enable synchronizing forks also. It is necessary in the fork, however to prepare the default cron branch with the same steps as in self.yml, so then the subsequent runs are functional. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Include a Containerfile that contains the common tools to compiling and checking the Linux Kernel across x86, arm and aarch64 architectures. The Container image can be run: * Interactively: login into and call build methods directly * Self-hosted run: host a github runner * Cluster run: host multiple github runners And is versioned, so runner instances can be progressively deployed. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
The ci/build.sh contains checking and building methods aware of the pushed/wants-to-merge commits. To show the warnings and errors on the GitHub GUI, each command is filtered and piped as GitHub annotations, tuned for the verbosity and format of each command, since there is no standardized output. The methods can also be called individually locally using the container, easing development and debugging. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
These workflows call the methods from ci/build.sh to check and compile the Linux Kernel in x86, aarch64, and arm architectures. The results of each job are collected and then checked against kernel.yml/assert. If any warning/error under 'fail' is logged, the CI fails; however, warning/error under 'warn' do not fail the CI. The reason is that some warnings are acceptable and shouldn't prevent CIs downstream from triggering. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Add a Python script to find dependencies of a symbol recursively. It is aware of 'source', 'if', 'config', and 'menuconfig' methods. At the 'depends' boolean logic, symbols '!' and '=n' are discarded; parentheses are not considered. A basic filter removes architecture symbols ('ARCH_*', 'CPU_*', ...) which are involved in most complex boolean expressions. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Interpret branches that are not mirrors are far behind or diverged from upstream. In this case, run the dt-bindings check checking out next/linux-next/master. It is limited to checking out only .yaml, so header changes have no effect and may cause the check to fail. Still, it is better to apply those changes closer to upstream, that means, targetting the mirror branches instead. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
754d4de
to
1b9a495
Compare
PR Description
Experimental use of self-hosted runners to speed-up CI checking by the use of caching git history between runs and versioned containerfiles with well defined tool versions.
This version focuses on providing code checking and linting, and not building artifacts.
The first commit adds a base documentation at docs for documentation non-upstream content, that is, continuous integrations and non upstream drivers.
Overall, non-upstream content is stored at .github, ci and docs, with the exception of devicetrees and defconfigs.
This is used by the workflows themself to skip jobs or checking non-relevant files.
Code checking
For checking, the following features are implemented:
Minimal defconfigs are added to enable only the driver of interest.
Workflow
Containerfile
Sample run
sample cached run: https://github.com/gastmaier/adi-linux/actions/runs/14976764241/job/42072683004
sample cold start run: https://github.com/gastmaier/adi-linux/actions/runs/14976764241/attempts/1
Next steps
The intention is to run these along-side the existing azure ci, then migrate all missing functionality if better results.
When merged to main, pushes to main and PRs will run the kernel.yml worklow, and once a day the mirror branches will be updated.
PR Type
PR Checklist