forked from barebox/barebox
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (101 loc) · 3.9 KB
/
Copy pathtest-labgrid-pytest.yml
File metadata and controls
129 lines (101 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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/multi_v8_defconfig.yaml
defconfig: multi_v8_defconfig
lgargs: --runxfail
- ARCH: mips
lgenv: test/mips/qemu-malta_defconfig.yaml
defconfig: qemu-malta_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: 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: 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
./MAKEALL -O ${KBUILD_OUTPUT} -l "" -v 0 ${{matrix.defconfig}}
if [ ${{matrix.arch}} = "riscv" ]; then
cp /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin ${KBUILD_OUTPUT}/
fi
- name: Populate testfs
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
- name: labgrid-pytest
run: |
export KBUILD_OUTPUT=build-${{matrix.arch}}-${{matrix.defconfig}}
for i in ${{matrix.lgenv}}; do
grep -wq '\(QEMUDriver\|ExternalConsoleDriver\):' "$i" || continue
extraargs="${{matrix.lgargs}}"
if grep -wq 'testfs' "$i"; then
extraargs="${extraargs} --fs testfs=${KBUILD_OUTPUT}/testfs"
fi
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: 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
- name: Publish Labgrid Log Results
uses: actions/upload-artifact@v4
if: steps.build.outcome == 'success'
with:
name: console-log-${{matrix.defconfig}}
path: log/
if-no-files-found: error