-
Notifications
You must be signed in to change notification settings - Fork 32
101 lines (94 loc) · 3.83 KB
/
kernel-test.yml
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
name: Reusable test workflow
on:
workflow_call:
inputs:
arch:
required: true
type: string
description: The architecture to build against, e.g x86_64, aarch64, s390x...
toolchain_full:
required: true
type: string
description: The toolchain and for llvm, its version, e.g gcc, llvm-15
runs_on:
required: true
type: string
description: The runners to run the test on. This is a json string representing an array of labels.
kernel:
required: true
type: string
description: The kernel to run the test against. For KPD this is always LATEST, which runs against a newly built kernel.
test:
required: true
type: string
description: The test to run in the vm, e.g test_progs, test_maps, test_progs_no_alu32...
continue_on_error:
required: true
type: string
description: Whether to continue on error. This is typically set to true for parallel tests which are currently known to fail, but we don't want to fail the whole CI because of that.
timeout_minutes:
required: true
type: number
description: In case a test runs for too long, after how many seconds shall we timeout and error.
jobs:
test:
name: ${{ inputs.test }} on ${{ inputs.arch }} with ${{ inputs.toolchain_full }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: 100
env:
ARCH: ${{ inputs.arch }}
KERNEL: ${{ inputs.kernel }}
REPO_ROOT: ${{ github.workspace }}
REPO_PATH: ""
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
# booleans are weird in GH.
CONTINUE_ON_ERROR: ${{ inputs.continue_on_error }}
DEPLOYMENT: ${{ github.repository == 'kernel-patches/bpf' && 'prod' || 'rc' }}
ALLOWLIST_FILE: /tmp/allowlist
DENYLIST_FILE: /tmp/denylist
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
ci
- uses: actions/download-artifact@v4
with:
name: vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}
path: .
- name: Untar artifacts
# zstd is installed by default in the runner images.
run: zstd -d -T0 vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst --stdout | tar -xf -
- name: Prepare ALLOW/DENYLIST
env:
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
run: |
cat "${SELFTESTS_BPF}/ALLOWLIST" \
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}" \
"${VMTEST_CONFIGS}/ALLOWLIST" \
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}" \
2> /dev/null > "${ALLOWLIST_FILE}" || true
cat "${SELFTESTS_BPF}/DENYLIST" \
"${SELFTESTS_BPF}/DENYLIST.${ARCH}" \
"${VMTEST_CONFIGS}/DENYLIST" \
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}" \
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}" \
2> /dev/null > "${DENYLIST_FILE}" || true
- name: Run selftests
uses: libbpf/ci/run-vmtest@v2
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
# booleans are weird in GH.
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
timeout-minutes: ${{ inputs.timeout_minutes }}
env:
TEST_PROGS_WATCHDOG_TIMEOUT: 300
with:
arch: ${{ inputs.arch }}
vmlinuz: '${{ github.workspace }}/vmlinuz'
kernel-root: ${{ env.REPO_ROOT }}
max-cpu: 8
kernel-test: ${{ inputs.test }}
# Here we must use kbuild-output local to the repo, because
# it was extracted from the artifacts.
kbuild-output: ${{ env.REPO_ROOT }}/kbuild-output