mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2386 from openmv/ci_clang
github: Add LLVM toolchain to CI.
This commit is contained in:
commit
3c4cfbdcd2
12
.github/workflows/firmware.yml
vendored
12
.github/workflows/firmware.yml
vendored
@ -43,8 +43,10 @@ jobs:
|
|||||||
uses: actions/cache@v4.0.2
|
uses: actions/cache@v4.0.2
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: ~/cache/gcc
|
path: |
|
||||||
key: 'arm-gnu-toolchain-13.2.rel1'
|
~/cache/gcc
|
||||||
|
~/cache/llvm
|
||||||
|
key: 'toolchain'
|
||||||
|
|
||||||
- name: '🐍 Install Python'
|
- name: '🐍 Install Python'
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@ -57,10 +59,14 @@ jobs:
|
|||||||
pip install ethos-u-vela==3.12.0
|
pip install ethos-u-vela==3.12.0
|
||||||
vela --version
|
vela --version
|
||||||
|
|
||||||
- name: '🛠 Install toolchain '
|
- name: '🛠 Install GCC toolchain '
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: source tools/ci.sh && ci_install_arm_gcc
|
run: source tools/ci.sh && ci_install_arm_gcc
|
||||||
|
|
||||||
|
- name: '🛠 Install LLVM toolchain '
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
run: source tools/ci.sh && ci_install_arm_llvm
|
||||||
|
|
||||||
- name: '🏗 Build firmware'
|
- name: '🏗 Build firmware'
|
||||||
run: source tools/ci.sh && ci_build_target ${{ matrix.target }}
|
run: source tools/ci.sh && ci_build_target ${{ matrix.target }}
|
||||||
|
|
||||||
|
|||||||
25
tools/ci.sh
25
tools/ci.sh
@ -2,19 +2,24 @@
|
|||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# Install ARM GCC.
|
# Install ARM GCC.
|
||||||
TOOLCHAIN_PATH=${HOME}/cache/gcc
|
GCC_TOOLCHAIN_PATH=${HOME}/cache/gcc
|
||||||
TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz"
|
GCC_TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz"
|
||||||
|
|
||||||
ci_install_arm_gcc_apt() {
|
LLVM_TOOLCHAIN_PATH=${HOME}/cache/llvm
|
||||||
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi
|
LLVM_TOOLCHAIN_URL="https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-18.1.3/LLVM-ET-Arm-18.1.3-Linux-x86_64.tar.xz"
|
||||||
|
|
||||||
|
ci_install_arm_gcc() {
|
||||||
|
mkdir -p ${GCC_TOOLCHAIN_PATH}
|
||||||
|
wget --no-check-certificate -O - ${GCC_TOOLCHAIN_URL} | tar --strip-components=1 -Jx -C ${GCC_TOOLCHAIN_PATH}
|
||||||
|
export PATH=${GCC_TOOLCHAIN_PATH}/bin:${PATH}
|
||||||
arm-none-eabi-gcc --version
|
arm-none-eabi-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
ci_install_arm_gcc() {
|
ci_install_arm_llvm() {
|
||||||
mkdir -p ${TOOLCHAIN_PATH}
|
mkdir -p ${LLVM_TOOLCHAIN_PATH}
|
||||||
wget --no-check-certificate -O - ${TOOLCHAIN_URL} | tar --strip-components=1 -Jx -C ${TOOLCHAIN_PATH}
|
wget --no-check-certificate -O - ${LLVM_TOOLCHAIN_URL} | tar --strip-components=1 -Jx -C ${LLVM_TOOLCHAIN_PATH}
|
||||||
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
|
export PATH=${LLVM_TOOLCHAIN_PATH}/bin:${PATH}
|
||||||
arm-none-eabi-gcc --version
|
clang --version
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
@ -30,7 +35,7 @@ ci_update_submodules() {
|
|||||||
# Build Targets.
|
# Build Targets.
|
||||||
|
|
||||||
ci_build_target() {
|
ci_build_target() {
|
||||||
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
|
export PATH=${GCC_TOOLCHAIN_PATH}/bin:${PATH}
|
||||||
make -j$(nproc) -C src/micropython/mpy-cross
|
make -j$(nproc) -C src/micropython/mpy-cross
|
||||||
make -j$(nproc) TARGET=${1} -C src
|
make -j$(nproc) TARGET=${1} -C src
|
||||||
mv src/build/bin ${1}
|
mv src/build/bin ${1}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user