Skip to content

Commit

Permalink
build-linux: try container action
Browse files Browse the repository at this point in the history
  • Loading branch information
theihor committed Nov 29, 2024
1 parent 57fddec commit 13b1ddb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions build-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

18 changes: 8 additions & 10 deletions build-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 13b1ddb

Please sign in to comment.