4646jobs :
4747 build :
4848 name : build kernel and selftests ${{ inputs.release && '-O2' || '' }}
49- # To run on CodeBuild, runs-on value must correspond to the AWS
50- # CodeBuild project associated with the kernel-patches webhook
51- # However matrix.py passes just a 'codebuild' string
52- runs-on : >-
53- ${{
54- contains(fromJSON(inputs.runs_on), 'codebuild')
55- && format('codebuild-bpf-ci-{0}-{1}', github.run_id, github.run_attempt)
56- || fromJSON(inputs.runs_on)
57- }}
49+ runs-on :
50+ - ${{ github.repository == 'kernel-patches/bpf-rc' && 'ubuntu-latest'
51+ || format('codebuild-bpf-ci-{0}-{1}', github.run_id, github.run_attempt) }}
52+ # AWS docs about image override: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-action-runners-update-labels.html
53+ - image:${{ inputs.arch == 'aarch64' && 'custom-arm-ghcr.io/kernel-patches/runner:kbuilder-debian-aarch64'
54+ || 'custom-linux-ghcr.io/kernel-patches/runner:kbuilder-debian-x86_64' }}
5855 env :
5956 ARTIFACTS_ARCHIVE : " vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst"
60- BPF_NEXT_BASE_BRANCH : ' master'
6157 BPF_NEXT_FETCH_DEPTH : 64 # A bit of history is needed to facilitate incremental builds
62- CROSS_COMPILE : ${{ inputs.arch != 'x86_64 ' && 'true' || '' }}
58+ CROSS_COMPILE : ${{ inputs.arch == 's390x ' && 'true' || '' }}
6359 BUILD_SCHED_EXT_SELFTESTS : ${{ inputs.arch == 'x86_64' || inputs.arch == 'aarch64' && 'true' || '' }}
6460 KBUILD_OUTPUT : ${{ github.workspace }}/kbuild-output
6561 KERNEL : ${{ inputs.kernel }}
6662 KERNEL_ROOT : ${{ github.workspace }}
63+ KERNEL_ORIGIN : ${{ github.repository == 'kernel-patches/bpf-rc' && 'https://github.com/kernel-patches/bpf-rc.git'
64+ || 'https://github.com/kernel-patches/bpf.git'
65+ }}
66+ KERNEL_REVISION : ${{ inputs.download_sources && 'bpf-next' || github.sha }}
6767 REFERENCE_REPO_PATH : /libbpfci/mirrors/linux
6868 REPO_PATH : " "
6969 REPO_ROOT : ${{ github.workspace }}
70- RUNNER_TYPE : ${{ contains(fromJSON(inputs.runs_on), ' codebuild') && 'codebuild' || 'default' }}
70+ RUNNER_TYPE : codebuild
7171 steps :
7272
73- # git version 2.43.0 (current Ubuntu 24 installation)
74- # does not support git clone --revision option
75- # so make sure latest git is installed
76- - name : Install latest git
77- shell : bash
78- run : |
79- sudo apt-get update
80- sudo apt-get install -y software-properties-common
81- sudo add-apt-repository -y ppa:git-core/ppa
82- sudo apt-get update
83- sudo apt-get install -y git
84- git --version
85-
86- - uses : actions/checkout@v4
73+ - uses : actions/checkout@v6
8774 with :
8875 sparse-checkout : |
8976 .github
@@ -93,42 +80,14 @@ jobs:
9380 shell : bash
9481 run : .github/scripts/tmpfsify-workspace.sh
9582
96- - if : ${{ ! inputs.download_sources }}
97- name : git clone ${{ github.repository }}@${{ github.sha }}
98- shell : bash
99- run : |
100- if [ -d "${{ env.REFERENCE_REPO_PATH }}" ]; then
101- git clone \
102- --revision ${{ github.sha }} \
103- --reference-if-able ${{ env.REFERENCE_REPO_PATH }} \
104- https://github.com/${{ github.repository }}.git .kernel
105- else
106- git clone \
107- --revision ${{ github.sha }} \
108- --depth ${{ inputs.download_sources && 1 || env.BPF_NEXT_FETCH_DEPTH }} \
109- https://github.com/${{ github.repository }}.git .kernel
110- fi
111-
112- - if : ${{ inputs.download_sources }}
113- name : Download bpf-next tree
83+ - name : Download bpf-next tree @ ${{ env.KERNEL_REVISION }}
84+ uses : libbpf/ci/get-linux-source@v4
11485 env :
11586 FETCH_DEPTH : ${{ env.BPF_NEXT_FETCH_DEPTH }}
116- uses : libbpf/ci/get-linux-source@v3
11787 with :
11888 dest : ' .kernel'
119- rev : ${{ env.BPF_NEXT_BASE_BRANCH }}
120-
121- - uses : libbpf/ci/prepare-incremental-build@v3
122- with :
123- repo-root : ' .kernel'
124- base-branch : >-
125- ${{ inputs.download_sources && env.BPF_NEXT_BASE_BRANCH
126- || github.event_name == 'pull_request' && github.base_ref
127- || github.ref_name
128- }}
129- arch : ${{ inputs.arch }}
130- toolchain_full : ${{ inputs.toolchain_full }}
131- kbuild-output : ${{ env.KBUILD_OUTPUT }}
89+ repo : ${{ env.KERNEL_ORIGIN }}
90+ rev : ${{ env.KERNEL_REVISION }}
13291
13392 - name : Move linux source in place
13493 shell : bash
@@ -139,33 +98,21 @@ jobs:
13998 cd ..
14099 rmdir .kernel
141100
142- - uses : libbpf/ci/patch-kernel@v3
101+ - uses : libbpf/ci/patch-kernel@v4
143102 with :
144103 patches-root : ' ${{ github.workspace }}/ci/diffs'
145104 repo-root : ${{ env.REPO_ROOT }}
146105
147106 - name : Setup build environment
148- uses : libbpf/ci/setup-build-env@v3
107+ uses : libbpf/ci/setup-build-env@v4
149108 with :
150109 arch : ${{ inputs.arch }}
151110 gcc-version : ${{ inputs.gcc_version }}
152111 llvm-version : ${{ inputs.llvm_version }}
153112 pahole : master
154113
155- # We have to setup qemu+binfmt in order to enable cross-compation of selftests.
156- # During selftests build, freshly built bpftool is executed.
157- # On self-hosted bare-metal hosts binfmt is pre-configured.
158- - if : ${{ env.RUNNER_TYPE == 'codebuild' && env.CROSS_COMPILE }}
159- name : Set up docker
160- uses : docker/setup-docker-action@v4
161- - if : ${{ env.RUNNER_TYPE == 'codebuild' && env.CROSS_COMPILE }}
162- name : Setup binfmt and qemu
163- uses : docker/setup-qemu-action@v3
164- with :
165- image : tonistiigi/binfmt:qemu-v9.2.0
166-
167114 - name : Build kernel image
168- uses : libbpf/ci/build-linux@v3
115+ uses : libbpf/ci/build-linux@v4
169116 with :
170117 arch : ${{ inputs.arch }}
171118 toolchain : ${{ inputs.toolchain }}
@@ -174,7 +121,7 @@ jobs:
174121 llvm-version : ${{ inputs.llvm_version }}
175122
176123 - name : Build selftests/bpf
177- uses : libbpf/ci/build-selftests@v3
124+ uses : libbpf/ci/build-selftests@v4
178125 env :
179126 MAX_MAKE_JOBS : 32
180127 RELEASE : ${{ inputs.release && '1' || '' }}
@@ -186,7 +133,7 @@ jobs:
186133
187134 - if : ${{ env.BUILD_SCHED_EXT_SELFTESTS }}
188135 name : Build selftests/sched_ext
189- uses : libbpf/ci/build-scx-selftests@v3
136+ uses : libbpf/ci/build-scx-selftests@v4
190137 with :
191138 kbuild-output : ${{ env.KBUILD_OUTPUT }}
192139 repo-root : ${{ env.REPO_ROOT }}
@@ -197,7 +144,7 @@ jobs:
197144
198145 - if : ${{ github.event_name != 'push' }}
199146 name : Build samples
200- uses : libbpf/ci/build-samples@v3
147+ uses : libbpf/ci/build-samples@v4
201148 with :
202149 arch : ${{ inputs.arch }}
203150 toolchain : ${{ inputs.toolchain }}
@@ -206,7 +153,7 @@ jobs:
206153 llvm-version : ${{ inputs.llvm_version }}
207154 - name : Tar artifacts
208155 id : tar-artifacts
209- uses : libbpf/ci/tar-artifacts@v3
156+ uses : libbpf/ci/tar-artifacts@v4
210157 env :
211158 ARCHIVE_BPF_SELFTESTS : ' true'
212159 ARCHIVE_MAKE_HELPERS : ' true'
0 commit comments