From 13b1ddb829895cb535b585c7e0e3126ea6b963af Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Thu, 28 Nov 2024 15:27:06 -0800 Subject: [PATCH] build-linux: try container action --- .github/workflows/kernel-build.yml | 14 -------------- build-linux/Dockerfile | 22 ++++++++++++++++++++++ build-linux/action.yml | 18 ++++++++---------- 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 build-linux/Dockerfile diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index 67a3fc5..7ef15f1 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -90,20 +90,6 @@ jobs: with: patches-root: '${{ github.workspace }}/ci/diffs' repo-root: ${{ env.REPO_ROOT }} - - name: Setup build environment - uses: ./setup-build-env - with: - arch: ${{ inputs.arch }} - llvm-version: ${{ inputs.llvm-version }} - pahole: master - - name: Print toolchain version used - shell: bash - run: | - TOOLCHAIN=${{ inputs.toolchain }} - if [ $TOOLCHAIN = "llvm" ]; then - TOOLCHAIN="clang-${{ inputs.llvm-version }}" - fi - ${TOOLCHAIN} --version - name: Build kernel image uses: ./build-linux with: diff --git a/build-linux/Dockerfile b/build-linux/Dockerfile new file mode 100644 index 0000000..27ae107 --- /dev/null +++ b/build-linux/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:noble + +ARG LLVM_VERSION=17 +ARG PAHOLE_BRANCH=master +ARG PAHOLE_ORIGIN=https://git.kernel.org/pub/scm/devel/pahole/pahole.git +ARG TARGET_ARCH=x86_64 + +RUN apt-get update && apt-get install -y \ + bash bc binutils bison cmake diffutils elfutils findutils flex \ + gcc git gnupg libdw-dev libelf-dev libssl-dev libzstd-dev make \ + openssl perl sudo udev util-linux wget zstd + +RUN git clone -b v2 --depth 1 https://github.com/libbpf/ci.git /ci/actions + +RUN /ci/actions/setup-build-env/build_pahole.sh +RUN /ci/actions/setup-build-env/install_clang.sh +RUN /ci/actions/setup-build-env/install_cross_compilation_toolchain.sh $TARGET_ARCH + +ENV GITHUB_WORKSPACE=/github/workspace +WORKDIR /github/workspace +ENTRYPOINT ["/ci/actions/build-linux/build.sh"] + diff --git a/build-linux/action.yml b/build-linux/action.yml index 4711ff4..b697ef8 100644 --- a/build-linux/action.yml +++ b/build-linux/action.yml @@ -18,13 +18,11 @@ inputs: required: false default: '16' runs: - using: "composite" - steps: - - name: build linux - shell: bash - run: | - kbuild_output="$(realpath ${{ inputs.kbuild-output }})" - export LLVM_VERSION=${{ inputs.llvm-version }} - ${GITHUB_ACTION_PATH}/build.sh "${{ inputs.arch }}" "${{ inputs.toolchain }}" "${kbuild_output}" - env: - MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }} + using: 'docker' + image: ghcr.io/theihor/kbuilder-test + args: + - ${{ inputs.arch }} + - ${{ inputs.toolchain }} + - ${{ inputs.kbuild-output }} + env: + MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }}