-
Notifications
You must be signed in to change notification settings - Fork 32
119 lines (113 loc) · 4.06 KB
/
kernel-build-test.yml
File metadata and controls
119 lines (113 loc) · 4.06 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
name: Reusable Build/Test/Veristat 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
toolchain:
required: true
type: string
description: The toolchain, e.g gcc, llvm
runs_on:
required: true
type: string
description: The runners to run the test on. This is a json string representing an array of labels.
build_runs_on:
required: true
type: string
description: The runners to run the builds on. This is a json string representing an array of labels.
gcc_version:
required: true
type: string
description: GCC version to install
llvm_version:
required: true
type: string
description: LLVM version to install
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.
tests:
required: true
type: string
description: A serialized json array with the tests to be running, it must follow the json-matrix format, https://www.jitsejan.com/use-github-actions-with-json-file-as-matrix
run_tests:
required: true
type: boolean
description: Whether or not to run the test job.
download_sources:
required: true
type: boolean
description: Whether to download the linux sources into the working directory.
default: false
build_release:
required: true
type: boolean
description: Build selftests with -O2 optimization in addition to non-optimized build.
default: false
jobs:
# Build kernel and selftest
build:
uses: ./.github/workflows/kernel-build.yml
with:
arch: ${{ inputs.arch }}
toolchain_full: ${{ inputs.toolchain_full }}
toolchain: ${{ inputs.toolchain }}
runs_on: ${{ inputs.build_runs_on }}
gcc_version: ${{ inputs.gcc_version }}
llvm_version: ${{ inputs.llvm_version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}
build-release:
if: ${{ inputs.build_release }}
uses: ./.github/workflows/kernel-build.yml
with:
arch: ${{ inputs.arch }}
toolchain_full: ${{ inputs.toolchain_full }}
toolchain: ${{ inputs.toolchain }}
runs_on: ${{ inputs.build_runs_on }}
gcc_version: ${{ inputs.gcc_version }}
llvm_version: ${{ inputs.llvm_version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}
release: true
test:
if: ${{ inputs.run_tests }}
uses: ./.github/workflows/kernel-test.yml
# Setting name to test here to avoid lengthy autogenerated names due to matrix
# e.g build-and-test x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
name: "test"
needs: [build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.tests) }}
with:
arch: ${{ inputs.arch }}
toolchain_full: ${{ inputs.toolchain_full }}
runs_on: ${{ inputs.runs_on }}
kernel: ${{ inputs.kernel }}
test: ${{ matrix.test }}
continue_on_error: ${{ toJSON(matrix.continue_on_error) }}
timeout_minutes: ${{ matrix.timeout_minutes }}
llvm_version: ${{ inputs.llvm_version }}
gcc-bpf:
name: 'GCC BPF'
if: ${{ inputs.arch == 'x86_64' }}
uses: ./.github/workflows/gcc-bpf.yml
needs: [build]
with:
# GCC BPF does not need /dev/kvm, so use the "build" runners
runs_on: ${{ inputs.build_runs_on }}
arch: ${{ inputs.arch }}
gcc_version: ${{ inputs.gcc_version }}
llvm_version: ${{ inputs.llvm_version }}
toolchain: ${{ inputs.toolchain }}
toolchain_full: ${{ inputs.toolchain_full }}
download_sources: ${{ inputs.download_sources }}