Skip to content

Commit

Permalink
tar-artifacts.sh: don't rely on kbuild-output to be in kernel repo
Browse files Browse the repository at this point in the history
  • Loading branch information
theihor committed Sep 17, 2024
1 parent d949503 commit 33aca10
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
40 changes: 24 additions & 16 deletions .github/scripts/tar-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,33 @@ if [ $archive_make_helpers -ne 0 ]; then
# 'make kernelrelease' and bpf tool checks later on.
mapfile -t additional_file_list < <(find . -iname Makefile)
additional_file_list+=(
"scripts/"
"tools/testing/selftests/bpf/"
"tools/include/"
"scripts/"
"tools/testing/selftests/bpf/"
"tools/include/"
"tools/bpf/bpftool/"
)
fi

image_name=$(make ARCH="$(platform_to_kernel_arch "${arch}")" -s image_name)

# zstd is installed by default in the runner images.
tar -cf - \
"${KBUILD_OUTPUT}/.config" \
"${KBUILD_OUTPUT}/${image_name}" \
"${KBUILD_OUTPUT}/include/config/auto.conf" \
"${KBUILD_OUTPUT}/include/generated/autoconf.h" \
"${KBUILD_OUTPUT}/vmlinux" \
"${additional_file_list[@]}" \
--exclude '*.cmd' \
--exclude '*.d' \
--exclude '*.h' \
--exclude '*.output' \
selftests/bpf/ | zstd -T0 -19 -o "vmlinux-${arch}-${toolchain}.tar.zst"
kbuild_output_file_list=(
".config"
"${image_name}"
"include/config/auto.conf"
"include/generated/autoconf.h"
"vmlinux"
)

# Assumptions:
# - $(pwd) is the root of kernel repo we're tarring
# - zstd is installed by default in the runner images
tar -cf - \
-C "$KBUILD_OUTPUT" \
"${kbuild_output_file_list[@]}" \
-C "$(pwd)" \
"${additional_file_list[@]}" \
--exclude '*.cmd' \
--exclude '*.d' \
--exclude '*.output' \
selftests/bpf/ \
| zstd -T0 -19 -o "vmlinux-${arch}-${toolchain}.tar.zst"
1 change: 1 addition & 0 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
max-make-jobs: 32
llvm-version: ${{ inputs.llvm-version }}
- name: Tar artifacts
working-directory: ${{ env.REPO_ROOT }}
run: |
bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }} 1
- if: ${{ github.event_name != 'push' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
arch: ${{ inputs.arch }}
img: '/tmp/root.img'
vmlinuz: '${{ github.workspace }}/vmlinuz'
kernel-root: '.'
kernel-root: ${{ env.REPO_ROOT }}
max-cpu: 8
kernel-test: ${{ inputs.test }}
kbuild-output: ${{ env.KBUILD_OUTPUT }}

0 comments on commit 33aca10

Please sign in to comment.