github: Enable caching workflow dependencies.

* Use cache for GNU Arm Embedded Toolchain.
This commit is contained in:
iabdalkader 2022-02-19 23:32:30 +02:00
parent 635178124a
commit 23df7c73bc
2 changed files with 15 additions and 5 deletions

View File

@ -37,7 +37,15 @@ jobs:
- name: '🧱 Update submodules'
run: source tools/ci.sh && ci_update_submodules
- name: '♻ Caching dependencies'
uses: actions/cache@v2
id: cache
with:
path: ~/cache/gcc
key: 'gcc-arm-none-eabi-10-2020-q4-major'
- name: '🛠 Install toolchain '
if: steps.cache.outputs.cache-hit != 'true'
run: source tools/ci.sh && ci_install_arm_gcc
- name: '🏗 Build firmware'

View File

@ -2,6 +2,9 @@
########################################################################################
# Install ARM GCC.
TOOLCHAIN="gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2"
TOOLCHAIN_PATH=${HOME}/cache/gcc
TOOLCHAIN_URL="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/${TOOLCHAIN}"
ci_install_arm_gcc_apt() {
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi
@ -9,10 +12,9 @@ ci_install_arm_gcc_apt() {
}
ci_install_arm_gcc() {
mkdir ${HOME}/gcc
GCC_URL="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2"
wget --no-check-certificate -O - ${GCC_URL} | tar --strip-components=1 -jx -C ${HOME}/gcc
export PATH=${HOME}/gcc/bin:${PATH}
mkdir -p ${TOOLCHAIN_PATH}
wget --no-check-certificate -O - ${TOOLCHAIN_URL} | tar --strip-components=1 -jx -C ${TOOLCHAIN_PATH}
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
arm-none-eabi-gcc --version
}
@ -29,7 +31,7 @@ ci_update_submodules() {
# Build Targets.
ci_build_target() {
export PATH=${HOME}/gcc/bin:${PATH}
export PATH=${TOOLCHAIN_PATH}/bin:${PATH}
make -j$(nproc) -C src/micropython/mpy-cross
make -j$(nproc) TARGET=${1} -C src
mkdir firmware