Repository navigation
166 lines (132 loc) · 5.15 KB
/
Copy pathtest-labgrid-pytest.yml
File metadata and controls
166 lines (132 loc) · 5.15 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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 --graphics
- ARCH: arm
lgenv: test/arm/virt32_secure_defconfig.yaml
defconfig: virt32_secure_defconfig
- ARCH: arm
lgenv: test/arm/multi_v8_efiloader_defconfig.yaml
defconfig: multi_v8_efiloader_defconfig
osimg: debian-13.x.y-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 \
common/boards/configs/enable_werror.config"
if [ ${{matrix.arch}} = sandbox ] && [ ${{matrix.defconfig}} = allyesconfig ]; then
KCONFIG_ADD="${KCONFIG_ADD} CONFIG_CONSOLE_DISABLE_INPUT=n CONFIG_MALLOC_LIBC=y \
CONFIG_CONSOLE_ACTIVATE_ALL=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