mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 01/14] gitignore: don't ignore files in .github/ directory
@ 2023-06-05  6:36 Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 02/14] test/Containerfile: reduce duplication in cross toolchain handling Ahmad Fatoum
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The directory holds our workflow files and it shouldn't require git add
-f to add new files there.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index dd36d5083b17..d2487d548376 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ Module.symvers
 #
 !.gitignore
 !.mailmap
+!.github/
 
 #
 # Generated include files
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 02/14] test/Containerfile: reduce duplication in cross toolchain handling
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 03/14] test/Containerfile: install only one RISC-V toolchain Ahmad Fatoum
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

ENV directive in OCI will result in the container having the environment
variable defined. Let's use that instead of duplicating it across
workflows.

Also the many wget's to get the kernel toolchains are not that readable,
so define a function and call it to make it easier to see what is what.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/test-defconfigs.yml     |  6 ------
 .github/workflows/test-labgrid-pytest.yml |  6 ------
 test/Containerfile                        | 25 +++++++++++++++--------
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/.github/workflows/test-defconfigs.yml b/.github/workflows/test-defconfigs.yml
index 108e54d289a0..71e440793ce5 100644
--- a/.github/workflows/test-defconfigs.yml
+++ b/.github/workflows/test-defconfigs.yml
@@ -32,12 +32,6 @@ jobs:
       run: |
         export ARCH=${{matrix.arch}}
 
-        export CROSS_COMPILE_arm=/opt/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
-        export CROSS_COMPILE_arm64=/opt/gcc-12.2.0-nolibc/aarch64-linux/bin/aarch64-linux-
-        export CROSS_COMPILE_mips=/opt/gcc-12.2.0-nolibc/mips-linux/bin/mips-linux-
-        export CROSS_COMPILE_powerpc=/opt/gcc-12.2.0-nolibc/powerpc-linux/bin/powerpc-linux-
-        export CROSS_COMPILE_riscv=/opt/gcc-12.2.0-nolibc/riscv32-linux/bin/riscv32-linux-
-
         ./test/generate-dummy-fw.sh
 
         ./MAKEALL -O build-${{matrix.arch}} -k test/kconfig/disable_size_check.kconf \
diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 2c741500663e..399de6dc077a 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -42,12 +42,6 @@ jobs:
       run: |
         export ARCH=${{matrix.arch}}
 
-        export CROSS_COMPILE_arm=/opt/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
-        export CROSS_COMPILE_arm64=/opt/gcc-12.2.0-nolibc/aarch64-linux/bin/aarch64-linux-
-        export CROSS_COMPILE_mips=/opt/gcc-12.2.0-nolibc/mips-linux/bin/mips-linux-
-        export CROSS_COMPILE_powerpc=/opt/gcc-12.2.0-nolibc/powerpc-linux/bin/powerpc-linux-
-        export CROSS_COMPILE_riscv=/opt/gcc-12.2.0-nolibc/riscv32-linux/bin/riscv32-linux-
-
         ./test/generate-dummy-fw.sh
 
         ./MAKEALL -O build-${{matrix.arch}} -k test/kconfig/enable_self_test.kconf \
diff --git a/test/Containerfile b/test/Containerfile
index 8c9502c0a190..ff08cc1a7841 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -64,14 +64,17 @@ RUN apt-get update && apt-get install -y \
 	libyaml-libyaml-perl \
 	&& rm -rf /var/lib/apt/lists/*
 
-# Manually install the kernel.org Crosstool based toolchains for gcc-12.2.0
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-aarch64-linux.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-arm-linux-gnueabi.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-i386-linux.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-mips-linux.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-powerpc-linux.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-riscv64-linux.tar.xz | tar -C /opt -xJ
-RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-riscv32-linux.tar.xz | tar -C /opt -xJ
+ENV GCC_VERSION=12.2.0
+
+# Manually install the kernel.org Crosstool based toolchains
+RUN korg_crosstool_dl() { wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} arm-linux-gnueabi && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} aarch64-linux     && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} i386-linux        && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} mips-linux        && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} powerpc-linux     && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} riscv32-linux     && \
+    korg_crosstool_dl x86_64 ${GCC_VERSION} riscv64-linux
 
 RUN wget "https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin?raw=true" -O /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
 
@@ -86,4 +89,10 @@ RUN cd /tmp && \
     pip3 install . && \
     ln -s $(which pytest) /usr/local/bin/labgrid-pytest;
 
+ENV CROSS_COMPILE_arm=/opt/gcc-${GCC_VERSION}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
+ENV CROSS_COMPILE_arm64=/opt/gcc-${GCC_VERSION}-nolibc/aarch64-linux/bin/aarch64-linux-
+ENV CROSS_COMPILE_mips=/opt/gcc-${GCC_VERSION}-nolibc/mips-linux/bin/mips-linux-
+ENV CROSS_COMPILE_powerpc=/opt/gcc-${GCC_VERSION}-nolibc/powerpc-linux/bin/powerpc-linux-
+ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv32-linux/bin/riscv32-linux-
+
 USER barebox:barebox
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 03/14] test/Containerfile: install only one RISC-V toolchain
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 02/14] test/Containerfile: reduce duplication in cross toolchain handling Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 04/14] test/Containerfile: drop i386 toolchain Ahmad Fatoum
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

riscv32-linux- and riscv64-linux- seem to only differ in defaults and
both are capable of compiling rv32 and rv64 code and indeed only one
toolchain was actually used.

It's probably less surprising to use rv64 toolchain for both rv32 and
v64, so let's keep only that and drop the non-unused rv32 toolchain.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/Containerfile b/test/Containerfile
index ff08cc1a7841..e637c68b4d08 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -73,7 +73,6 @@ RUN korg_crosstool_dl() { wget -O - https://mirrors.edge.kernel.org/pub/tools/cr
     korg_crosstool_dl x86_64 ${GCC_VERSION} i386-linux        && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} mips-linux        && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} powerpc-linux     && \
-    korg_crosstool_dl x86_64 ${GCC_VERSION} riscv32-linux     && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} riscv64-linux
 
 RUN wget "https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin?raw=true" -O /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
@@ -93,6 +92,6 @@ ENV CROSS_COMPILE_arm=/opt/gcc-${GCC_VERSION}-nolibc/arm-linux-gnueabi/bin/arm-l
 ENV CROSS_COMPILE_arm64=/opt/gcc-${GCC_VERSION}-nolibc/aarch64-linux/bin/aarch64-linux-
 ENV CROSS_COMPILE_mips=/opt/gcc-${GCC_VERSION}-nolibc/mips-linux/bin/mips-linux-
 ENV CROSS_COMPILE_powerpc=/opt/gcc-${GCC_VERSION}-nolibc/powerpc-linux/bin/powerpc-linux-
-ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv32-linux/bin/riscv32-linux-
+ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv64-linux/bin/riscv64-linux-
 
 USER barebox:barebox
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 04/14] test/Containerfile: drop i386 toolchain
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 02/14] test/Containerfile: reduce duplication in cross toolchain handling Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 03/14] test/Containerfile: install only one RISC-V toolchain Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 05/14] test/Containerfile: update to GCC 13.1.0 Ahmad Fatoum
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

It's unused and barebox EFI may not work properly for non-x86_64 anyway.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/test/Containerfile b/test/Containerfile
index e637c68b4d08..4ca690714a2f 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -70,7 +70,6 @@ ENV GCC_VERSION=12.2.0
 RUN korg_crosstool_dl() { wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} arm-linux-gnueabi && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} aarch64-linux     && \
-    korg_crosstool_dl x86_64 ${GCC_VERSION} i386-linux        && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} mips-linux        && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} powerpc-linux     && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} riscv64-linux
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 05/14] test/Containerfile: update to GCC 13.1.0
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 04/14] test/Containerfile: drop i386 toolchain Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 06/14] test/Containerfile: drop unneeded dependencies Ahmad Fatoum
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

This is the newest GCC toolchain available at
https://mirrors.edge.kernel.org/pub/tools/crosstool
So let's install that to hopefully get some better warnings.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/Containerfile b/test/Containerfile
index 4ca690714a2f..7a737ecd33c6 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \
 	libyaml-libyaml-perl \
 	&& rm -rf /var/lib/apt/lists/*
 
-ENV GCC_VERSION=12.2.0
+ENV GCC_VERSION=13.1.0
 
 # Manually install the kernel.org Crosstool based toolchains
 RUN korg_crosstool_dl() { wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 06/14] test/Containerfile: drop unneeded dependencies
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 05/14] test/Containerfile: update to GCC 13.1.0 Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 07/14] ci: test-defconfigs.yml: rename to build-defconfigs.yml Ahmad Fatoum
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Smaller containerfiles leads to quicker tests and the container has apt
installed, so manual debugging can always install what may be missing.

Thus drop a number of dependencies that are now unneeded.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/test/Containerfile b/test/Containerfile
index 7a737ecd33c6..5b5fade82e49 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -11,21 +11,11 @@ ENV DEBIAN_FRONTEND=noninteractive
 
 # Update and install things from apt now
 RUN apt-get update && apt-get install -y \
-	automake \
-	autopoint \
-	bc \
-	binutils-dev \
 	bison \
 	build-essential \
 	coreutils \
-	cpio \
-	cppcheck \
-	curl \
-	erofs-utils \
-	expect \
 	flex \
 	gawk \
-	gdisk \
 	git \
 	imagemagick \
 	libc6-i386 \
@@ -42,10 +32,7 @@ RUN apt-get update && apt-get install -y \
 	mount \
 	openssl \
 	pkg-config \
-	rpm2cpio \
 	util-linux \
-	uuid-dev \
-	zip \
 	wget \
 	qemu-system-arm \
 	qemu-system-misc \
@@ -58,10 +45,7 @@ RUN apt-get update && apt-get install -y \
 	python3-virtualenv \
 	python3-setuptools \
 	virtualenv \
-	microcom \
 	sudo \
-	libyaml-tiny-perl \
-	libyaml-libyaml-perl \
 	&& rm -rf /var/lib/apt/lists/*
 
 ENV GCC_VERSION=13.1.0
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 07/14] ci: test-defconfigs.yml: rename to build-defconfigs.yml
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (4 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 06/14] test/Containerfile: drop unneeded dependencies Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 08/14] ci: shorten name in YAML files Ahmad Fatoum
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Having both workflows with test in the name can be confusing, so rename
the one that does the build test to build-defconfigs.yml.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/{test-defconfigs.yml => build-defconfigs.yml} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename .github/workflows/{test-defconfigs.yml => build-defconfigs.yml} (100%)

diff --git a/.github/workflows/test-defconfigs.yml b/.github/workflows/build-defconfigs.yml
similarity index 100%
rename from .github/workflows/test-defconfigs.yml
rename to .github/workflows/build-defconfigs.yml
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 08/14] ci: shorten name in YAML files
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (5 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 07/14] ci: test-defconfigs.yml: rename to build-defconfigs.yml Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 09/14] ci: don't fail fast Ahmad Fatoum
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Shorter names look better in the Github Actions UI.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/build-defconfigs.yml    | 2 +-
 .github/workflows/test-labgrid-pytest.yml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build-defconfigs.yml b/.github/workflows/build-defconfigs.yml
index 71e440793ce5..d8813ade7ca1 100644
--- a/.github/workflows/build-defconfigs.yml
+++ b/.github/workflows/build-defconfigs.yml
@@ -1,4 +1,4 @@
-name: build all defconfigs
+name: build images
 
 on: [push, pull_request]
 
diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 399de6dc077a..2f823664a4ef 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -1,4 +1,4 @@
-name: test images with labgrid-pytest
+name: test images
 
 on: [push, pull_request]
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 09/14] ci: don't fail fast
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (6 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 08/14] ci: shorten name in YAML files Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 10/14] ci: don't use deprecated Node.js 12 actions Ahmad Fatoum
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

If one job experiences failure, it should not cancel pending jobs for
other defconfigs.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/build-defconfigs.yml    | 1 +
 .github/workflows/test-labgrid-pytest.yml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.github/workflows/build-defconfigs.yml b/.github/workflows/build-defconfigs.yml
index d8813ade7ca1..c205944f2660 100644
--- a/.github/workflows/build-defconfigs.yml
+++ b/.github/workflows/build-defconfigs.yml
@@ -11,6 +11,7 @@ jobs:
       options: --user=root --privileged -v /dev:/dev
 
     strategy:
+      fail-fast: false
       matrix:
         arch: [mips, powerpc, riscv, sandbox, x86 ]
         regex: ["*"]
diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 2f823664a4ef..e0b9cbf799f4 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -11,6 +11,7 @@ jobs:
       options: --user=root --privileged -v /dev:/dev
 
     strategy:
+      fail-fast: false
       matrix:
 
         include:
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 10/14] ci: don't use deprecated Node.js 12 actions
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (7 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 09/14] ci: don't fail fast Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 11/14] ci: pytest: upload artifacts Ahmad Fatoum
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We currently get some warnings about Node.js 12 use in actions/checkout@v2.
actions/checkout@v3 fixes this, so let's switch to that.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/build-defconfigs.yml    | 2 +-
 .github/workflows/container.yml           | 2 +-
 .github/workflows/test-labgrid-pytest.yml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-defconfigs.yml b/.github/workflows/build-defconfigs.yml
index c205944f2660..c5c294300e03 100644
--- a/.github/workflows/build-defconfigs.yml
+++ b/.github/workflows/build-defconfigs.yml
@@ -27,7 +27,7 @@ jobs:
 
     steps:
     - name: Checkout code
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
 
     - name: Build
       run: |
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 434745ae61e8..7a9b2fe74d57 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -13,7 +13,7 @@ jobs:
   build:
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
     - id: build-image
       uses: redhat-actions/buildah-build@v2
       with:
diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index e0b9cbf799f4..ae49decbaeae 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -37,7 +37,7 @@ jobs:
 
     steps:
     - name: Checkout code
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
 
     - name: Build
       run: |
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 11/14] ci: pytest: upload artifacts
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (8 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 10/14] ci: don't use deprecated Node.js 12 actions Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 12/14] ci: build: dynamically generate build matrix Ahmad Fatoum
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

pytest can output junit XML files and labgrid writes a console_main file
with serial output. Let's collect both as artifacts of the build to make
it easier to debug issues.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/test-labgrid-pytest.yml | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index ae49decbaeae..6647237284d9 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -60,6 +60,22 @@ jobs:
         export KBUILD_OUTPUT=build-${{matrix.arch}}
 
         for i in ${{matrix.lgenv}}; do
-          echo "Testing $i"
-          labgrid-pytest --lg-env $i test/py --verbosity=1 --lg-log
+          cfg=$(basename $i .yaml)
+          echo "Testing $cfg"
+          labgrid-pytest --lg-env $i test/py --verbosity=1 \
+          --junitxml=$cfg.tests.xml --lg-log=log/$cfg
         done
+
+    - name: Publish Test Results
+      uses: EnricoMi/publish-unit-test-result-action@v2
+      if: always()
+      with:
+        files: ./*.tests.xml
+
+    - name: Publish Labgrid Log Results
+      uses: actions/upload-artifact@v3
+      if: always()
+      with:
+        name: Console Logs
+        path: log/
+        if-no-files-found: error
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 12/14] ci: build: dynamically generate build matrix
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (9 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 11/14] ci: pytest: upload artifacts Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 13/14] test: labgrid-env: rv64i: use QEmu built-in openSBI Ahmad Fatoum
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have some manual chunking of defconfigs, which makes it more
difficult to see on a glance which defconfig failed.

Let's add a job that generates a JSON of all available defconfigs
for the selected architectures and use that as build matrix for the
build job.

This gives us higher parallelism at the cost of more IO in the form
of container pulls and repository (--depth=1) fetches.

All in all, it seems to save 5 minutes execution time on average, so
let's make use of it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/build-defconfigs.yml | 30 +++++++++++++++-----------
 scripts/list-defconfigs.sh             | 15 +++++++++++++
 2 files changed, 32 insertions(+), 13 deletions(-)
 create mode 100755 scripts/list-defconfigs.sh

diff --git a/.github/workflows/build-defconfigs.yml b/.github/workflows/build-defconfigs.yml
index c5c294300e03..ff9264721d87 100644
--- a/.github/workflows/build-defconfigs.yml
+++ b/.github/workflows/build-defconfigs.yml
@@ -2,8 +2,23 @@ name: build images
 
 on: [push, pull_request]
 
+env:
+  ARCH: arm mips powerpc riscv sandbox x86
+
 jobs:
+  defconfigs:
+    runs-on: ubuntu-latest
+    outputs:
+      matrix: ${{ steps.set-matrix.outputs.matrix }}
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v3
+
+      - name: Collect defconfigs
+        id: set-matrix
+        run: echo "matrix=$(scripts/list-defconfigs.sh $ARCH)" >> $GITHUB_OUTPUT
   build:
+    needs: defconfigs
     runs-on: ubuntu-latest
     container:
       image: ghcr.io/barebox/barebox/barebox-ci:latest
@@ -12,18 +27,7 @@ jobs:
 
     strategy:
       fail-fast: false
-      matrix:
-        arch: [mips, powerpc, riscv, sandbox, x86 ]
-        regex: ["*"]
-        include:
-          - arch: arm
-            regex: "[a-b]*"
-          - arch: arm
-            regex: "[c-m]*"
-          - arch: arm
-            regex: "[n-q]*"
-          - arch: arm
-            regex: "[r-z]*"
+      matrix: ${{ fromJSON(needs.defconfigs.outputs.matrix) }}
 
     steps:
     - name: Checkout code
@@ -36,4 +40,4 @@ jobs:
         ./test/generate-dummy-fw.sh
 
         ./MAKEALL -O build-${{matrix.arch}} -k test/kconfig/disable_size_check.kconf \
-                -k test/kconfig/disable_target_tools.kconf -e '${{matrix.regex}}'
+                -k test/kconfig/disable_target_tools.kconf '${{matrix.config}}'
diff --git a/scripts/list-defconfigs.sh b/scripts/list-defconfigs.sh
new file mode 100755
index 000000000000..eeae9fbfdc30
--- /dev/null
+++ b/scripts/list-defconfigs.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Output json formatted defconfig list for Github Action consumption
+
+ARCH=${@:-*}
+
+cd arch
+
+archs=$(for arch in $ARCH; do
+	ls -1 $arch/configs | xargs -i printf '{ "arch": "%s", "config": "%s" }\n' \
+		"$arch" "{}" | paste -sd ',' -
+done | paste -sd ',' -)
+
+echo '{ "include" : '" [ $archs ] }"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 13/14] test: labgrid-env: rv64i: use QEmu built-in openSBI
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (10 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 12/14] ci: build: dynamically generate build matrix Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-05  6:36 ` [PATCH 14/14] ci: pytest: test RISCV 64-bit as well Ahmad Fatoum
  2023-06-06  9:39 ` [PATCH 01/14] gitignore: don't ignore files in .github/ directory Sascha Hauer
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have some magic "runner:" keys in our labgrid env YAMLs to paper over
quirks, like that Qemu v5.2.0 depends on OpenSBI 32-bit firmware for
Qemu Virt, but doesn't ship it.

Now that we have a blessed test/Containerfile, we should adopt that as
baseline and drop all quirks that are not needed for that system.

Qemu v5.2.0 in Debian bullseye still doesn't ship OpenSBI 32-bit
firmware, but it ships the 64-bit one, so there's no need to download
the latter.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/riscv/qemu-virt64@rv64i_defconfig.yaml | 5 -----
 test/riscv/sifive@rv64i_defconfig.yaml      | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/test/riscv/qemu-virt64@rv64i_defconfig.yaml b/test/riscv/qemu-virt64@rv64i_defconfig.yaml
index fefbd20e5c99..ee121f153619 100644
--- a/test/riscv/qemu-virt64@rv64i_defconfig.yaml
+++ b/test/riscv/qemu-virt64@rv64i_defconfig.yaml
@@ -7,7 +7,6 @@ targets:
         cpu: rv64
         memory: 256M
         kernel: barebox-dt-2nd.img
-        bios: opensbi-riscv64-generic-fw_dynamic.bin
         extra_args: ''
       BareboxDriver:
         prompt: 'barebox@[^:]+:[^ ]+ '
@@ -15,12 +14,8 @@ targets:
       BareboxTestStrategy: {}
     features:
       - virtio-mmio
-    runner:
-      download:
-        opensbi-riscv64-generic-fw_dynamic.bin: https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin?raw=true
 images:
   barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
-  opensbi-riscv64-generic-fw_dynamic.bin: !template "$LG_BUILDDIR/opensbi-riscv64-generic-fw_dynamic.bin"
 tools:
   qemu: /usr/bin/qemu-system-riscv64
 imports:
diff --git a/test/riscv/sifive@rv64i_defconfig.yaml b/test/riscv/sifive@rv64i_defconfig.yaml
index f7299453a499..303f96299766 100644
--- a/test/riscv/sifive@rv64i_defconfig.yaml
+++ b/test/riscv/sifive@rv64i_defconfig.yaml
@@ -7,18 +7,13 @@ targets:
         cpu: sifive-u54
         memory: 256M
         kernel: barebox-hifive-unleashed.img
-        bios: opensbi-riscv64-generic-fw_dynamic.bin
         extra_args: ''
       BareboxDriver:
         prompt: 'barebox@[^:]+:[^ ]+ '
         bootstring: 'commandline:'
       BareboxTestStrategy: {}
-    runner:
-      download:
-        opensbi-riscv64-generic-fw_dynamic.bin: https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin?raw=true
 images:
   barebox-hifive-unleashed.img: !template "$LG_BUILDDIR/images/barebox-hifive-unleashed.img"
-  opensbi-riscv64-generic-fw_dynamic.bin: !template "$LG_BUILDDIR/opensbi-riscv64-generic-fw_dynamic.bin"
 tools:
   qemu: /usr/bin/qemu-system-riscv64
 imports:
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 14/14] ci: pytest: test RISCV 64-bit as well
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (11 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 13/14] test: labgrid-env: rv64i: use QEmu built-in openSBI Ahmad Fatoum
@ 2023-06-05  6:36 ` Ahmad Fatoum
  2023-06-06  9:39 ` [PATCH 01/14] gitignore: don't ignore files in .github/ directory Sascha Hauer
  13 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have labgrid environments for two Qemu rv64i machines:

  - RISC-V Virt 64-bit
  - SiFive HiFive Unleashed

The first one is readily testable, but the second hangs during cat
/env/data/config. This isn't reproducible interactively and needs
further looking into, so we just enable a single config for now.

emulate.pl also supports a TinyEMUDriver, which is not supported by
labgrid. To avoid passing it to labgrid when globbing in the future, we
add a grep with an early continue.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/test-labgrid-pytest.yml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 6647237284d9..5b17c701a7bb 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -35,6 +35,10 @@ jobs:
             lgenv: test/riscv/qemu@virt32_defconfig.yaml
             defconfig: virt32_defconfig
 
+          - ARCH: riscv
+            lgenv: 'test/riscv/qemu-virt64@rv64i_defconfig.yaml'
+            defconfig: rv64i_defconfig
+
     steps:
     - name: Checkout code
       uses: actions/checkout@v3
@@ -60,6 +64,8 @@ jobs:
         export KBUILD_OUTPUT=build-${{matrix.arch}}
 
         for i in ${{matrix.lgenv}}; do
+          grep -wqe QEMUDriver: "$i" || continue
+
           cfg=$(basename $i .yaml)
           echo "Testing $cfg"
           labgrid-pytest --lg-env $i test/py --verbosity=1 \
-- 
2.39.2




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/14] gitignore: don't ignore files in .github/ directory
  2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
                   ` (12 preceding siblings ...)
  2023-06-05  6:36 ` [PATCH 14/14] ci: pytest: test RISCV 64-bit as well Ahmad Fatoum
@ 2023-06-06  9:39 ` Sascha Hauer
  13 siblings, 0 replies; 15+ messages in thread
From: Sascha Hauer @ 2023-06-06  9:39 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Jun 05, 2023 at 08:36:10AM +0200, Ahmad Fatoum wrote:
> The directory holds our workflow files and it shouldn't require git add
> -f to add new files there.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

Sascha

> 
> diff --git a/.gitignore b/.gitignore
> index dd36d5083b17..d2487d548376 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -52,6 +52,7 @@ Module.symvers
>  #
>  !.gitignore
>  !.mailmap
> +!.github/
>  
>  #
>  # Generated include files
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-06  9:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05  6:36 [PATCH 01/14] gitignore: don't ignore files in .github/ directory Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 02/14] test/Containerfile: reduce duplication in cross toolchain handling Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 03/14] test/Containerfile: install only one RISC-V toolchain Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 04/14] test/Containerfile: drop i386 toolchain Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 05/14] test/Containerfile: update to GCC 13.1.0 Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 06/14] test/Containerfile: drop unneeded dependencies Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 07/14] ci: test-defconfigs.yml: rename to build-defconfigs.yml Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 08/14] ci: shorten name in YAML files Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 09/14] ci: don't fail fast Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 10/14] ci: don't use deprecated Node.js 12 actions Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 11/14] ci: pytest: upload artifacts Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 12/14] ci: build: dynamically generate build matrix Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 13/14] test: labgrid-env: rv64i: use QEmu built-in openSBI Ahmad Fatoum
2023-06-05  6:36 ` [PATCH 14/14] ci: pytest: test RISCV 64-bit as well Ahmad Fatoum
2023-06-06  9:39 ` [PATCH 01/14] gitignore: don't ignore files in .github/ directory Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox