ci: kernel auto build on thead-gcc & mainline-gcc

thead-gcc: v2.8.0
mainline-gcc: v13.2

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
This commit is contained in:
Han Gao
2023-11-29 07:40:40 +08:00
committed by Han Gao
parent 556f057aca
commit 06bd593cfd

View File

@@ -8,26 +8,29 @@ on:
- cron: "0 2 * * *"
env:
xuetie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1663142514282
toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-20220906.tar.gz
xuantie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1698113812618
toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.0-20231018.tar.gz
mainline_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.10.18
mainline_toolchain_file_name: riscv64-glibc-ubuntu-22.04-gcc-nightly-2023.10.18-nightly.tar.gz
wget_alias: 'wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0'
ARCH: riscv
board: lpi4a
KBUILD_BUILD_USER: builder
KBUILD_BUILD_HOST: revyos-riscv-builder
KDEB_COMPRESS: xz
KDEB_CHANGELOG_DIST: unstable
jobs:
kernel:
strategy:
fail-fast: false
matrix:
name: [thead-gcc, gcc-12]
name: [thead-gcc, gcc-13]
board: [lpi4a, ahead]
include:
- name: thead-gcc
toolchain_tripe: riscv64-unknown-linux-gnu-
- name: gcc-12
toolchain_tripe: riscv64-linux-gnu-
runs-on: ubuntu-22.04
env:
CROSS_COMPILE: ${{ matrix.toolchain_tripe }}
CROSS_COMPILE: riscv64-unknown-linux-gnu-
steps:
- name: Install software
@@ -37,27 +40,25 @@ jobs:
libncurses-dev gawk flex bison openssl libssl-dev tree \
dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf device-tree-compiler \
devscripts
sudo update-alternatives --install \
/usr/bin/riscv64-linux-gnu-gcc riscv64-gcc /usr/bin/riscv64-linux-gnu-gcc-12 10
sudo update-alternatives --install \
/usr/bin/riscv64-linux-gnu-g++ riscv64-g++ /usr/bin/riscv64-linux-gnu-g++-12 10
- name: Checkout kernel
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'kernel'
- name: Configure toolchains
run: |
mkdir rootfs && mkdir rootfs/boot
if [ x"${{ matrix.name }}" = x"thead-gcc" ]; then
wget ${xuetie_toolchain}/${toolchain_file_name}
tar -xvf ${toolchain_file_name} -C /opt
fi
- name: Compile Kernel && Install
run: |
export PATH="/opt/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1/bin:$PATH"
mkdir -p rootfs
if [[ ${{ matrix.name }} = "thead-gcc" ]]; then
${wget_alias} ${xuantie_toolchain}/${toolchain_file_name}
tar -xvf ${toolchain_file_name} -C /opt
export PATH="/opt/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.0/bin:$PATH"
else
${wget_alias} ${mainline_toolchain}/${mainline_toolchain_file_name}
tar -xvf ${mainline_toolchain_file_name} -C /opt
export PATH="/opt/riscv/bin:$PATH"
fi
${CROSS_COMPILE}gcc -v
pushd kernel
if [ x"${{ matrix.board }}" = x"lpi4a" ]; then
@@ -66,29 +67,20 @@ jobs:
make revyos_beaglev_defconfig
fi
export KDEB_PKGVERSION="$(date "+%Y.%m.%d.%H.%M")+$(git rev-parse --short HEAD)"
if [ x"${{ matrix.name }}" = x"gcc-12" ]; then
if [ x"${{ matrix.name }}" = x"gcc-13" ]; then
echo "CONFIG_THEAD_ISA=n" >> .config
elif [ x"${{ matrix.name }}" = x"thead-gcc" ]; then
echo "CONFIG_THEAD_ISA=y" >> .config
fi
sed -i '/CONFIG_LOCALVERSION_AUTO/d' .config && echo "CONFIG_LOCALVERSION_AUTO=n" >> .config
make -j$(nproc) bindeb-pkg LOCALVERSION="-${{ matrix.board }}"
make -j$(nproc) dtbs
# Copy deb
sudo dcmd cp -v ../*.changes ${GITHUB_WORKSPACE}/rootfs/
# build perf & install
# make LDFLAGS=-static NO_LIBELF=1 NO_JVMTI=1 VF=1 -C tools/perf/
# sudo mkdir -p ${GITHUB_WORKSPACE}/rootfs/sbin/
# sudo cp -v tools/perf/perf ${GITHUB_WORKSPACE}/rootfs/sbin/perf-thead
# record commit-id
git rev-parse HEAD > ${{ matrix.board }}-kernel-commitid
sudo cp -v ${{ matrix.board }}-kernel-commitid ${GITHUB_WORKSPACE}/rootfs/boot/
# Install DTB
sudo cp -v arch/riscv/boot/dts/thead/{light-lpi4a.dtb,light-lpi4a-16gb.dtb,light-lpi4a-dsi0-hdmi.dtb,light-beagle.dtb} ${GITHUB_WORKSPACE}/rootfs/boot/
sudo cp -v ${{ matrix.board }}-kernel-commitid ${GITHUB_WORKSPACE}/rootfs/
ls -al ${GITHUB_WORKSPACE}/rootfs/
popd