-
Notifications
You must be signed in to change notification settings - Fork 118
129 lines (125 loc) · 4.48 KB
/
kernel-build-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
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: 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.
llvm-version:
required: true
type: string
description: The version of LLVM used to build selftest.... for llvm toolchain, this should match the one from toolchain_full, for gcc it is an arbritrary version we decide to build selftests against.
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_veristat:
required: true
type: boolean
description: Whether or not to run the veristat job.
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
secrets:
AWS_ROLE_ARN:
required: true
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 }}
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.runs_on }}
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 }}
veristat-kernel:
if: ${{ inputs.run_veristat }}
uses: ./.github/workflows/veristat-kernel.yml
needs: [build]
permissions:
id-token: write
contents: read
with:
arch: ${{ inputs.arch }}
toolchain: ${{ inputs.toolchain }}
runs_on: ${{ inputs.runs_on }}
veristat-meta:
# Check for vars.AWS_REGION is necessary to skip this job in case of a PR from a fork.
if: ${{ inputs.run_veristat && github.repository_owner == 'kernel-patches' && vars.AWS_REGION }}
uses: ./.github/workflows/veristat-meta.yml
needs: [build]
permissions:
id-token: write
contents: read
with:
arch: ${{ inputs.arch }}
toolchain: ${{ inputs.toolchain }}
aws_region: ${{ vars.AWS_REGION }}
runs_on: ${{ inputs.runs_on }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}