From 7097d93c037ba677786b1f2ecd3602f9d144b35d Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Fri, 27 Dec 2024 12:21:00 +0800 Subject: [PATCH] CI: Update Arm GNU Toolchain and use Ubuntu 24.04 The pre-built GNU compiler toolchain for various Arm targets. Version 14.2.Rel1. --- .ci/common.sh | 18 ++++++++++++++++++ .ci/cross-check.sh | 14 +++----------- .ci/cross-tool.sh | 15 +++------------ .github/workflows/main.yml | 6 +++--- 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 .ci/common.sh diff --git a/.ci/common.sh b/.ci/common.sh new file mode 100644 index 0000000..e716825 --- /dev/null +++ b/.ci/common.sh @@ -0,0 +1,18 @@ +GCC_REL=14.2.rel1 +ARM_MIRROR=https://github.com/DLTcollab/toolchain-arm/raw/main + +SOURCES=$(find $(git rev-parse --show-toplevel) | egrep "\.(cpp|h)\$" | egrep -v "arm-gnu-toolchain-${GCC_REL}-x86_64-aarch64-none-linux-gnu|arm-gnu-toolchain-${GCC_REL}-x86_64-arm-none-linux-gnueabihf") + +# Expect host is Linux/x86_64 +check_platform() +{ + MACHINE_TYPE=`uname -m` + if [ ${MACHINE_TYPE} != 'x86_64' ]; then + exit + fi + + OS_TYPE=`uname -s` + if [ ${OS_TYPE} != 'Linux' ]; then + exit + fi +} diff --git a/.ci/cross-check.sh b/.ci/cross-check.sh index 947b1bd..f963bc5 100755 --- a/.ci/cross-check.sh +++ b/.ci/cross-check.sh @@ -1,14 +1,8 @@ #!/usr/bin/env bash -MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} != 'x86_64' ]; then - exit -fi +. .ci/common.sh -OS_TYPE=`uname -s` -if [ ${OS_TYPE} != 'Linux' ]; then - exit -fi +check_platform # Clang/LLVM is natively a cross-compiler. # TODO: Do cross-compilation using Clang @@ -17,9 +11,7 @@ if [ $(printenv CXX | grep clang) ]; then exit fi -GCC_REL=11.2-2022.02 - set -x -export PATH=gcc-arm-${GCC_REL}-x86_64-arm-none-linux-gnueabihf/bin:$PATH +export PATH=arm-gnu-toolchain-${GCC_REL}-x86_64-arm-none-linux-gnueabihf/bin:$PATH make CROSS_COMPILE=arm-none-linux-gnueabihf- check || exit 1 diff --git a/.ci/cross-tool.sh b/.ci/cross-tool.sh index 1fc895f..cf04ac3 100755 --- a/.ci/cross-tool.sh +++ b/.ci/cross-tool.sh @@ -1,17 +1,8 @@ #!/usr/bin/env bash -ARM_MIRROR=https://github.com/DLTcollab/toolchain-arm/raw/main -GCC_REL=11.2-2022.02 +. .ci/common.sh -MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} != 'x86_64' ]; then - exit -fi - -OS_TYPE=`uname -s` -if [ ${OS_TYPE} != 'Linux' ]; then - exit -fi +check_platform set -x @@ -21,5 +12,5 @@ sudo apt-get install -q -y qemu-user sudo apt-get install -y curl xz-utils curl -L \ - ${ARM_MIRROR}/gcc-arm-${GCC_REL}-x86_64-arm-none-linux-gnueabihf.tar.xz \ + ${ARM_MIRROR}/arm-gnu-toolchain-${GCC_REL}-x86_64-arm-none-linux-gnueabihf.tar.xz \ | tar -Jx || exit 1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 449da75..023a1a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,13 +4,13 @@ on: [push, pull_request] jobs: host_x86: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: - compiler: [gcc-10] + compiler: [gcc] steps: - name: checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: build artifact env: CC: ${{ matrix.compiler }}