[PATCH 10/11] ci: pytest: Centralize feature discovery to a separate step
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Sep 22 08:45:24 PDT 2025
On 18.09.25 09:43, Tobias Waldekranz wrote:
> This avoids the need for each step to (re)discover features. Start off
> by only checking for 'testfs', but this can easily be expanded in the
> future.
>
> Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
> .github/workflows/test-labgrid-pytest.yml | 22 +++++++++++++++-------
> 1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
> index adec3defc1..6918ea1b98 100644
> --- a/.github/workflows/test-labgrid-pytest.yml
> +++ b/.github/workflows/test-labgrid-pytest.yml
> @@ -64,6 +64,17 @@ jobs:
> - name: Checkout code
> uses: actions/checkout at v4
>
> + - name: Determine used features
> + id: used-features
> + run: |
> + for i in ${{matrix.lgenv}}; do
> + if grep -wq 'testfs' "$i"; then
> + echo "testfs=true" >>$GITHUB_OUTPUT
> + exit
> + fi
> + done
> + echo "testfs=false" >> $GITHUB_OUTPUT
> +
> - name: Build
> id: build
> run: |
> @@ -83,17 +94,14 @@ jobs:
> fi
>
> - name: Populate testfs
> + if: steps.used-features.outputs.testfs == 'true'
> run: |
> export KBUILD_OUTPUT=build-${{matrix.arch}}-${{matrix.defconfig}}
> export KBUILD_DEFCONFIG=${{matrix.defconfig}}
>
> - for i in ${{matrix.lgenv}}; do
> - grep -wq 'testfs' "$i" || continue
> -
> - # Just use already built dtc
> - export PATH="$PATH:${KBUILD_OUTPUT}/scripts/dtc/"
> - exec scripts/generate_testfs.sh
> - done
> + # Just use already built dtc
> + export PATH="$PATH:${KBUILD_OUTPUT}/scripts/dtc/"
> + exec scripts/generate_testfs.sh
>
> - name: labgrid-pytest
> if: steps.build.outcome == 'success'
--
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 |
More information about the barebox
mailing list