mbox series

[0/2] gitlab-ci: Make separate sections for build and test

Message ID 20240918125449.3125571-1-peter.maydell@linaro.org
Headers show
Series gitlab-ci: Make separate sections for build and test | expand

Message

Peter Maydell Sept. 18, 2024, 12:54 p.m. UTC
This patchset uses gitlab's support for putting special lines
in the log output that it will interpret as the beginning and
end markers for a collapsible section in the build log.

That's documented here, but it's just "write a line with
the right format and a timestamp and a magic escape sequence
in it":
https://docs.gitlab.com/ee/ci/yaml/script.html#expand-and-collapse-job-log-sections

Since gitlab puts little "time taken" bubbles for each
collapsible section, we can use this to easily find out how
much time is taken for build versus test.

Patch 1 splits out "make" and "make check" to separate make
invocations for the cross-build templates; we do this for
the native-build already.

Patch 2 adds the shell functions that emit start and end
section markers, and puts in section lines in the job
templates.

Since this is just for convenience in looking at CI job logs,
I have not put in a lot of effort into dividing things into
sections -- I've mostly just put configure/build/test into
the templates. We can always tweak the sections later if
we find out it would be useful.

If you want to see what the resulting logs look like you
can look at the jobs in this pipeline:
https://gitlab.com/pm215/qemu/-/pipelines/1458593312

thanks
-- PMM

Peter Maydell (2):
  .gitlab-ci.d: Split build and test in cross build job templates
  .gitlab-ci.d: Make separate collapsible log sections for build and
    test

 .gitlab-ci.d/buildtest-template.yml  | 14 ++++++++
 .gitlab-ci.d/buildtest.yml           |  1 +
 .gitlab-ci.d/crossbuild-template.yml | 48 ++++++++++++++++++++++++++--
 scripts/ci/gitlab-ci-section         | 29 +++++++++++++++++
 4 files changed, 89 insertions(+), 3 deletions(-)
 create mode 100644 scripts/ci/gitlab-ci-section

Comments

Richard Henderson Sept. 18, 2024, 2:34 p.m. UTC | #1
On 9/18/24 14:54, Peter Maydell wrote:
> Peter Maydell (2):
>    .gitlab-ci.d: Split build and test in cross build job templates
>    .gitlab-ci.d: Make separate collapsible log sections for build and
>      test

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~