-
Notifications
You must be signed in to change notification settings - Fork 24
71 lines (69 loc) · 2.77 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
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:
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 }}
steps:
- uses: actions/checkout@v4
- 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: Run selftests
uses: ./run-vmtest
# 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 }}
with:
arch: ${{ inputs.arch }}
img: '/tmp/root.img'
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