mbox series

[dwarves,0/2] dwarves: Introduce github actions for CI

Message ID 20250306170455.2957229-1-alan.maguire@oracle.com (mailing list archive)
Headers show
Series dwarves: Introduce github actions for CI | expand

Message

Alan Maguire March 6, 2025, 5:04 p.m. UTC
libbpf and bpf kernel patch infrastructure have made great use
of github actions to provide continuous integration (CI) testing.
Here the libbpf CI is adapted to build pahole and run the associated
selftests.  Examples of what the action workflows look like are
at [1] and [2].

Details about the workflows can be found in patch 1.

Patch 2 fixes an issue exposed by the dwarves-build workflow -
a compilation error when building dwarves with clang.


[1] https://github.com/alan-maguire/dwarves/actions/runs/13588880188
[2] https://github.com/alan-maguire/dwarves/actions/runs/13588880200

Alan Maguire (2):
  dwarves: Add github actions to build, test
  dwarves: Fix clang warning about unused variable

 .github/actions/debian/action.yml | 16 ++++++
 .github/actions/setup/action.yml  | 23 ++++++++
 .github/workflows/build.yml       | 37 ++++++++++++
 .github/workflows/codeql.yml      | 53 +++++++++++++++++
 .github/workflows/coverity.yml    | 33 +++++++++++
 .github/workflows/lint.yml        | 20 +++++++
 .github/workflows/ondemand.yml    | 31 ++++++++++
 .github/workflows/test.yml        | 36 ++++++++++++
 .github/workflows/vmtest.yml      | 94 +++++++++++++++++++++++++++++++
 ci/managers/debian.sh             | 88 +++++++++++++++++++++++++++++
 ci/managers/travis_wait.bash      | 61 ++++++++++++++++++++
 dwarves_fprintf.c                 |  2 +-
 12 files changed, 493 insertions(+), 1 deletion(-)
 create mode 100644 .github/actions/debian/action.yml
 create mode 100644 .github/actions/setup/action.yml
 create mode 100644 .github/workflows/build.yml
 create mode 100644 .github/workflows/codeql.yml
 create mode 100644 .github/workflows/coverity.yml
 create mode 100644 .github/workflows/lint.yml
 create mode 100644 .github/workflows/ondemand.yml
 create mode 100644 .github/workflows/test.yml
 create mode 100644 .github/workflows/vmtest.yml
 create mode 100755 ci/managers/debian.sh
 create mode 100644 ci/managers/travis_wait.bash

Comments

Ihor Solodrai March 6, 2025, 9:14 p.m. UTC | #1
On 3/6/25 9:04 AM, Alan Maguire wrote:
> libbpf and bpf kernel patch infrastructure have made great use
> of github actions to provide continuous integration (CI) testing.
> Here the libbpf CI is adapted to build pahole and run the associated
> selftests.  Examples of what the action workflows look like are
> at [1] and [2].
>
> Details about the workflows can be found in patch 1.
>
> Patch 2 fixes an issue exposed by the dwarves-build workflow -
> a compilation error when building dwarves with clang.
>
>
> [1] https://github.com/alan-maguire/dwarves/actions/runs/13588880188
> [2] https://github.com/alan-maguire/dwarves/actions/runs/13588880200

Hi Alan. This is great! Glad to see you're working on it.

I haven't read through the changes yet, but I already see that most of
the CI code was copied from libbpf. Just want to note that you might
not want to reproduce all the workflows from there in dwarves. And
also there are inconveniences with local actions and ci/managers
etc. I think it's worth it to try and eliminate as much of that code
as possible, given you're starting from a blank slate.

If you haven't done so already, you might want to check out "pahole
staging" job that I tried on BPF CI infrastructure some time ago:
https://github.com/kernel-patches/vmtest/pull/330/files

It's a bit different from libbpf, as it reuses BPF CI workflows. But
you might get some ideas there about simplifying dwarves CI.

Another question is: are you sure about merging CI code upstream? Both
for libbpf and kernel-patches/bpf the CI code lives independently of
upstream and is synced from time to time on github. My guess is, it's
because .github code is unlikely to get merged into the main Linux
tree (which also makes sense).

>
> Alan Maguire (2):
>   dwarves: Add github actions to build, test
>   dwarves: Fix clang warning about unused variable
>
>  .github/actions/debian/action.yml | 16 ++++++
>  .github/actions/setup/action.yml  | 23 ++++++++
>  .github/workflows/build.yml       | 37 ++++++++++++
>  .github/workflows/codeql.yml      | 53 +++++++++++++++++
>  .github/workflows/coverity.yml    | 33 +++++++++++
>  .github/workflows/lint.yml        | 20 +++++++
>  .github/workflows/ondemand.yml    | 31 ++++++++++
>  .github/workflows/test.yml        | 36 ++++++++++++
>  .github/workflows/vmtest.yml      | 94 +++++++++++++++++++++++++++++++
>  ci/managers/debian.sh             | 88 +++++++++++++++++++++++++++++
>  ci/managers/travis_wait.bash      | 61 ++++++++++++++++++++
>  dwarves_fprintf.c                 |  2 +-
>  12 files changed, 493 insertions(+), 1 deletion(-)
>  create mode 100644 .github/actions/debian/action.yml
>  create mode 100644 .github/actions/setup/action.yml
>  create mode 100644 .github/workflows/build.yml
>  create mode 100644 .github/workflows/codeql.yml
>  create mode 100644 .github/workflows/coverity.yml
>  create mode 100644 .github/workflows/lint.yml
>  create mode 100644 .github/workflows/ondemand.yml
>  create mode 100644 .github/workflows/test.yml
>  create mode 100644 .github/workflows/vmtest.yml
>  create mode 100755 ci/managers/debian.sh
>  create mode 100644 ci/managers/travis_wait.bash
>
Alan Maguire March 12, 2025, 4:50 p.m. UTC | #2
On 06/03/2025 23:45, Arnaldo Carvalho de Melo wrote:
> 
> 
> On Thu, Mar 6, 2025, 6:14 PM Ihor Solodrai <ihor.solodrai@linux.dev
> <mailto:ihor.solodrai@linux.dev>> wrote:
> 
>     On 3/6/25 9:04 AM, Alan Maguire wrote:
>     > libbpf and bpf kernel patch infrastructure have made great use
>     > of github actions to provide continuous integration (CI) testing.
>     > Here the libbpf CI is adapted to build pahole and run the associated
>     > selftests.  Examples of what the action workflows look like are
>     > at [1] and [2].
>     >
>     > Details about the workflows can be found in patch 1.
>     >
>     > Patch 2 fixes an issue exposed by the dwarves-build workflow -
>     > a compilation error when building dwarves with clang.
>     >
>     >
>     > [1] https://github.com/alan-maguire/dwarves/actions/
>     runs/13588880188 <https://github.com/alan-maguire/dwarves/actions/
>     runs/13588880188>
>     > [2] https://github.com/alan-maguire/dwarves/actions/
>     runs/13588880200 <https://github.com/alan-maguire/dwarves/actions/
>     runs/13588880200>
> 
>     Hi Alan. This is great! Glad to see you're working on it.
> 
> 
> Indeed, having these tests in place is a really great development.
> 
> 
>     I haven't read through the changes yet, but I already see that most of
>     the CI code was copied from libbpf. Just want to note that you might
>     not want to reproduce all the workflows from there in dwarves. And
>     also there are inconveniences with local actions and ci/managers
>     etc. I think it's worth it to try and eliminate as much of that code
>     as possible, given you're starting from a blank slate.
> 
> 
>     If you haven't done so already, you might want to check out "pahole
>     staging" job that I tried on BPF CI infrastructure some time ago:
>     https://github.com/kernel-patches/vmtest/pull/330/files <https://
>     github.com/kernel-patches/vmtest/pull/330/files>
> 
>     It's a bit different from libbpf, as it reuses BPF CI workflows. But
>     you might get some ideas there about simplifying dwarves CI.
>

Hi Ihor,

There is a bit of redundancy in the way things work currently alright in
the vmtest workflow [1] since it uses libbpf/ci/setup-build-env@v3 to
set up LLVM etc and also builds pahole. That latter step isn't needed as
we are building pahole ourselves later on in the workflow in order to
test the current changes. But aside from that the only other libbpf ci
operation is getting the linux source via libbpf/ci/get-linux-source@v3.

In the case of the dwarves/pahole workflow I wanted to concentrate on
the steps that I normally do when testing changes: build pahole for
x86_64, aarch64, build a bpf-next kernel with it, and run the dwarves
selftests. BPF selftests are already covered by BPF CI and thanks to
your work we get pahole testing in BPF CI when changes land so that's great!

The build workflow could perhaps be simplified a bit, but I wanted to
preserve the value of having a matrix of toolchains (clang/gcc). There
may be more efficient ways to achieve that; hopefully we can evolve the
workflow to be more succinct in the future.

> 
> 
> I'll try to take a look as well.
> 
> 
>     Another question is: are you sure about merging CI code upstream? Both
>     for libbpf and kernel-patches/bpf the CI code lives independently of
>     upstream and is synced from time to time on github. My guess is, it's
>     because .github code is unlikely to get merged into the main Linux
>     tree (which also makes sense).
> 
> 
> I don't see a problem on having it in the pahole main repository, to
> stimulate adding new tests while developing new features, no?
> 

Yeah I think we're less constrained as we're not a kernel tree, we are
just hosted on git.kernel.org. Arnaldo rightly pointed out we should
have some instructions for how to trigger actions and use them to test
changes; I'll wait a bit for additional comments etc and send a v2
incorporating that (into the toplevel README perhaps?).

Thanks!

Alan

> - Arnaldo
> 
> From smartphone 
> 
> 
>     >
>     > Alan Maguire (2):
>     >   dwarves: Add github actions to build, test
>     >   dwarves: Fix clang warning about unused variable
>     >
>     >  .github/actions/debian/action.yml | 16 ++++++
>     >  .github/actions/setup/action.yml  | 23 ++++++++
>     >  .github/workflows/build.yml       | 37 ++++++++++++
>     >  .github/workflows/codeql.yml      | 53 +++++++++++++++++
>     >  .github/workflows/coverity.yml    | 33 +++++++++++
>     >  .github/workflows/lint.yml        | 20 +++++++
>     >  .github/workflows/ondemand.yml    | 31 ++++++++++
>     >  .github/workflows/test.yml        | 36 ++++++++++++
>     >  .github/workflows/vmtest.yml      | 94 ++++++++++++++++++++++++++
>     +++++
>     >  ci/managers/debian.sh             | 88 +++++++++++++++++++++++++++++
>     >  ci/managers/travis_wait.bash      | 61 ++++++++++++++++++++
>     >  dwarves_fprintf.c                 |  2 +-
>     >  12 files changed, 493 insertions(+), 1 deletion(-)
>     >  create mode 100644 .github/actions/debian/action.yml
>     >  create mode 100644 .github/actions/setup/action.yml
>     >  create mode 100644 .github/workflows/build.yml
>     >  create mode 100644 .github/workflows/codeql.yml
>     >  create mode 100644 .github/workflows/coverity.yml
>     >  create mode 100644 .github/workflows/lint.yml
>     >  create mode 100644 .github/workflows/ondemand.yml
>     >  create mode 100644 .github/workflows/test.yml
>     >  create mode 100644 .github/workflows/vmtest.yml
>     >  create mode 100755 ci/managers/debian.sh
>     >  create mode 100644 ci/managers/travis_wait.bash
>     >
>