From a900ea7454e0bf6ae091844c968923c9caf24730 Mon Sep 17 00:00:00 2001 From: Han Gao Date: Fri, 22 Nov 2024 20:15:56 +0800 Subject: [PATCH] ci: add k1 build Signed-off-by: Han Gao Signed-off-by: Han Gao --- .github/workflows/kernel.yml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/kernel.yml diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml new file mode 100644 index 00000000000000..e214dfce3f94d0 --- /dev/null +++ b/.github/workflows/kernel.yml @@ -0,0 +1,82 @@ +name: k1-kernel + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: "0 2 * * *" + +jobs: + build-kernel: + strategy: + fail-fast: false + matrix: + include: + - name: gcc-13 + board: k1 + + runs-on: ubuntu-24.04 + env: + ARCH: riscv + KBUILD_BUILD_USER: riscv + KBUILD_BUILD_HOST: riscv-builder + KDEB_COMPRESS: xz + board: ${{ matrix.board }} + CROSS_COMPILE: riscv64-linux-gnu- + + steps: + - name: Update Apt Cache + run: sudo apt update + + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + + - name: Checkout + uses: actions/checkout@v4 + with: + path: kernel + + - name: Install software + run: | + echo "deb [arch=riscv64,trusted=yes] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted" | sudo tee -a /etc/apt/sources.list + sudo apt install -y gdisk dosfstools build-essential \ + libncurses-dev gawk flex bison openssl libssl-dev tree \ + dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf \ + device-tree-compiler xz-utils devscripts ccache debhelper pahole \ + gcc-riscv64-linux-gnu + #sudo dpkg --add-architecture riscv64 + sudo apt update + sudo apt install -y libssl-dev:riscv64 libelf-dev:riscv64 + + - name: Compile Kernel && Install + run: | + mkdir -p artifact + ${CROSS_COMPILE}gcc -v + pushd kernel + export KDEB_PKGVERSION="$(date "+%Y.%m.%d.%H.%M")+$(git rev-parse --short HEAD)" + make k1_defconfig + make -j$(nproc) dtbs + make -j$(nproc) bindeb-pkg LOCALVERSION="-${board}" + sudo cp -v arch/riscv/boot/dts/spacemit/*.dtb ../artifact + sudo cp -v ../*.deb ../artifact + popd + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: k1-kernel-${{ matrix.name }}-${{ matrix.board }} + path: artifact/* + retention-days: 30