Skip to content

wip

wip #174

name: test images
on: [push, pull_request]
jobs:
labgrid-pytest:
runs-on: ubuntu-latest
container:
image: ghcr.io/barebox/barebox/barebox-ci:latest
# allow mounting and devtmpfs in the container
options: --user=root --privileged -v /dev:/dev
strategy:
fail-fast: false
matrix:
include:
- ARCH: arm
lgenv: 'test/arm/*@multi_v5_v6_defconfig.yaml'
defconfig: multi_v5_v6_defconfig
- ARCH: arm
lgenv: 'test/arm/*@multi_v7_defconfig.yaml'
defconfig: multi_v7_defconfig
- ARCH: arm
lgenv: 'test/arm/modules32_defconfig.yaml'
defconfig: modules32_defconfig
- ARCH: arm
lgenv: test/arm/multi_v8_defconfig.yaml
defconfig: multi_v8_defconfig
lgargs: --runxfail
- ARCH: arm
lgenv: test/arm/multi_v8_efiloader_defconfig.yaml
defconfig: multi_v8_efiloader_defconfig
osimg: debian-13.5.0-arm64-netinst.iso
- ARCH: mips
lgenv: test/mips/qemu-malta_defconfig.yaml
defconfig: qemu-malta_defconfig
- ARCH: arm
lgenv: test/arm/multi_v8_efi_defconfig.yaml
defconfig: multi_v8_efi_defconfig
- ARCH: mips
lgenv: test/mips/qemu-malta64el_defconfig.yaml
defconfig: qemu-malta64el_defconfig
- ARCH: openrisc
lgenv: test/openrisc/generic_defconfig.yaml
defconfig: generic_defconfig
- ARCH: powerpc
lgenv: test/powerpc/qemu-ppce500_defconfig.yaml
defconfig: qemu-ppce500_defconfig
- ARCH: x86
lgenv: test/x86/efi_defconfig.yaml
defconfig: efi_defconfig
- ARCH: riscv
lgenv: test/riscv/qemu@virt32_defconfig.yaml
defconfig: virt32_defconfig
- ARCH: riscv
lgenv: 'test/riscv/qemu-virt64@rv64i_defconfig.yaml'
defconfig: rv64i_defconfig
- ARCH: sandbox
lgenv: 'test/sandbox/sandbox_defconfig.yaml'
defconfig: sandbox_defconfig
- ARCH: sandbox
lgenv: 'test/sandbox/allyesconfig.yaml'
defconfig: allyesconfig
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache OS image
id: cache-osimg
if: ${{ matrix.osimg != '' }}
uses: actions/cache@v4
with:
path: ${{ matrix.osimg }}
key: osimg-${{ matrix.osimg }}
restore-keys: osimg-${{ matrix.osimg }}-
- name: Download OS image
if: ${{ steps.cache-osimg.outputs.cache-hit != 'true' && matrix.osimg != '' }}
run: |
echo "::warning::Cache miss - downloading fresh OS image from Debian infra."
scripts/fetch-os.sh
- 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: |
export KBUILD_OUTPUT=build-${{matrix.arch}}-${{matrix.defconfig}}
export ARCH=${{matrix.arch}}
export KCONFIG_ADD="common/boards/configs/enable_self_test.config \
common/boards/configs/disable_target_tools.config"
if [ ${{matrix.arch}} = sandbox ] && [ ${{matrix.defconfig}} = allyesconfig ]; then
KCONFIG_ADD="${KCONFIG_ADD} CONFIG_CONSOLE_DISABLE_INPUT=n CONFIG_MALLOC_LIBC=y"
fi
if [ "${{ steps.used-features.outputs.testfs }}" = "true" ]; then
KCONFIG_ADD="${KCONFIG_ADD} common/boards/configs/enable_dm_testing.config"
KCONFIG_ADD="${KCONFIG_ADD} common/boards/configs/enable_tlv_sig_testing.config"
fi
./MAKEALL -O ${KBUILD_OUTPUT} -l "" -v 0 ${{matrix.defconfig}}
- name: labgrid-pytest
if: steps.build.outcome == 'success'
run: |
export KBUILD_OUTPUT=build-${{matrix.arch}}-${{matrix.defconfig}}
for i in ${{matrix.lgenv}}; do
grep -wq '\(QEMUDriver\|ExternalConsoleDriver\):' "$i" || continue
extraargs="${{matrix.lgargs}}"
cfg=$(basename $i .yaml)
echo "Testing $cfg"
labgrid-pytest --lg-env $i test/py --verbosity=1 \
--junitxml=$cfg.tests.xml --lg-log=log/$cfg $extraargs
done
- name: Print Labgrid Console Output
if: always()
run: |
for i in ${{matrix.lgenv}}; do
grep -wq '\(QEMUDriver\|ExternalConsoleDriver\):' "$i" || continue
cfg=$(basename $i .yaml)
cat log/$cfg/* || true
done
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: steps.build.outcome == 'success'
with:
check_name: "Test Results (${{matrix.defconfig}})"
files: ./*.tests.xml