@@ -64,18 +64,37 @@ jobs:
6464 KBUILD_OUTPUT : ${{ github.workspace }}/kbuild-output
6565 KERNEL : ${{ inputs.kernel }}
6666 KERNEL_ROOT : ${{ github.workspace }}
67+ REFERENCE_REPO_PATH : /libbpfci/mirrors/linux
6768 REPO_PATH : " "
6869 REPO_ROOT : ${{ github.workspace }}
6970 RUNNER_TYPE : ${{ contains(fromJSON(inputs.runs_on), 'codebuild') && 'codebuild' || 'default' }}
7071 steps :
72+
7173 - uses : actions/checkout@v4
7274 with :
73- fetch-depth : ${{ inputs.download_sources && 1 || env.BPF_NEXT_FETCH_DEPTH }}
75+ sparse-checkout : |
76+ .github
77+ ci
7478
7579 - if : ${{ env.RUNNER_TYPE == 'codebuild' }}
7680 shell : bash
7781 run : .github/scripts/tmpfsify-workspace.sh
7882
83+ - if : ${{ ! inputs.download_sources }}
84+ name : Checkout {{ github.repository }}
85+ shell : bash
86+ run : |
87+ if [ -d "${{ env.REFERENCE_REPO_PATH }}" ]; then
88+ git clone \
89+ --reference-if-able ${{ env.REFERENCE_REPO_PATH }} \
90+ https://github.com/${{ github.repository }}.git .
91+ else
92+ git clone \
93+ --depth ${{ inputs.download_sources && 1 || env.BPF_NEXT_FETCH_DEPTH }} \
94+ https://github.com/${{ github.repository }}.git .
95+ fi
96+ git checkout ${{ github.sha }}
97+
7998 - if : ${{ inputs.download_sources }}
8099 name : Download bpf-next tree
81100 env :
84103 with :
85104 dest : ' .kernel'
86105 rev : ${{ env.BPF_NEXT_BASE_BRANCH }}
106+
87107 - uses : libbpf/ci/prepare-incremental-build@v3
88108 with :
89109 repo-root : ${{ inputs.download_sources && '.kernel' || env.REPO_ROOT }}
95115 arch : ${{ inputs.arch }}
96116 toolchain_full : ${{ inputs.toolchain_full }}
97117 kbuild-output : ${{ env.KBUILD_OUTPUT }}
118+
98119 - if : ${{ inputs.download_sources }}
99120 name : Move linux source in place
100121 shell : bash
@@ -104,6 +125,7 @@ jobs:
104125 mv -t .. $(ls -A)
105126 cd ..
106127 rmdir .kernel
128+
107129 - uses : libbpf/ci/patch-kernel@v3
108130 with :
109131 patches-root : ' ${{ github.workspace }}/ci/diffs'
0 commit comments