summaryrefslogtreecommitdiff
path: root/.github/actions/setup_toolchain
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-11-29 01:41:30 +0700
committerGitHub <[email protected]>2025-11-29 01:41:30 +0700
commit7ee288bc223db393d68c7bdb09bf7c05ffd2eb03 (patch)
tree0c706cb41224eceee1870535fd8de74d3798bb7b /.github/actions/setup_toolchain
parent583fe844e9e007a3a87c301c057c5128a8f249e0 (diff)
change armgcc setup to manual download due to issue with action (#3377)
* change armgcc setup to manual download due to issue with action * build windows, macos with cmake as well
Diffstat (limited to '.github/actions/setup_toolchain')
-rw-r--r--.github/actions/setup_toolchain/action.yml14
-rw-r--r--.github/actions/setup_toolchain/download/action.yml25
-rw-r--r--.github/actions/setup_toolchain/toolchain.json2
3 files changed, 26 insertions, 15 deletions
diff --git a/.github/actions/setup_toolchain/action.yml b/.github/actions/setup_toolchain/action.yml
index d15a29f20..f78fe4dd3 100644
--- a/.github/actions/setup_toolchain/action.yml
+++ b/.github/actions/setup_toolchain/action.yml
@@ -13,12 +13,6 @@ outputs:
runs:
using: "composite"
steps:
- - name: Install ARM GCC
- if: inputs.toolchain == 'arm-gcc'
- uses: carlosperate/arm-none-eabi-gcc-action@v1
- with:
- release: '14.2.Rel1'
-
- name: Pull ESP-IDF docker
if: inputs.toolchain == 'esp-idf'
uses: ./.github/actions/setup_toolchain/espressif
@@ -26,9 +20,7 @@ runs:
toolchain: ${{ inputs.toolchain }}
- name: Get Toolchain URL
- if: >-
- inputs.toolchain != 'arm-gcc' &&
- inputs.toolchain != 'esp-idf'
+ if: inputs.toolchain != 'esp-idf'
id: set-toolchain-url
env:
TOOLCHAIN: ${{ inputs.toolchain }}
@@ -39,9 +31,7 @@ runs:
shell: bash
- name: Download Toolchain
- if: >-
- inputs.toolchain != 'arm-gcc' &&
- inputs.toolchain != 'esp-idf'
+ if: inputs.toolchain != 'esp-idf'
uses: ./.github/actions/setup_toolchain/download
with:
toolchain: ${{ inputs.toolchain }}
diff --git a/.github/actions/setup_toolchain/download/action.yml b/.github/actions/setup_toolchain/download/action.yml
index af7a9ad4e..5a3f66cb1 100644
--- a/.github/actions/setup_toolchain/download/action.yml
+++ b/.github/actions/setup_toolchain/download/action.yml
@@ -26,6 +26,7 @@ runs:
TOOLCHAIN_URL: ${{ inputs.toolchain_url }}
run: |
mkdir -p ~/cache/${TOOLCHAIN}
+ FILE_EXT="${TOOLCHAIN_URL##*.}"
if [[ ${TOOLCHAIN} == rx-gcc ]]; then
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.run
@@ -34,9 +35,16 @@ runs:
elif [[ ${TOOLCHAIN} == arm-iar ]]; then
wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
wget --progress=dot:giga ${TOOLCHAIN_URL} -O ~/cache/${TOOLCHAIN}/cxarm.deb
- else
+ elif [[ ${FILE_EXT} == zip ]]; then
+ curl -L "$TOOLCHAIN_URL" -o toolchain.zip
+ unzip -q toolchain.zip -d ~/cache/${TOOLCHAIN}
+ ~/cache/${TOOLCHAIN}/xpack-arm-none-eabi-gcc-14.2.1-1.1/bin/arm-none-eabi-gcc.exe --version
+ elif [[ ${FILE_EXT} == gz ]]; then
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar.gz
tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar.gz
+ else
+ echo "Unsupported toolchain file extension: ${FILE_EXT}"
+ exit 1
fi
shell: bash
@@ -47,8 +55,19 @@ runs:
if [[ ${TOOLCHAIN} == arm-iar ]]; then
sudo dpkg -i ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
sudo apt install -y ~/cache/${TOOLCHAIN}/cxarm.deb
- echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
+ TOOLCHAIN_PATH="/opt/iar/cxarm/arm/bin"
else
- echo >> $GITHUB_PATH `echo ~/cache/${TOOLCHAIN}/*/bin`
+ # Find the single toolchain bin directory
+ TOOLCHAIN_BIN_DIRS=(~/cache/${TOOLCHAIN}/*/bin)
+ if [[ ${#TOOLCHAIN_BIN_DIRS[@]} -ne 1 ]]; then
+ echo "Error: Expected exactly one toolchain bin directory, found ${#TOOLCHAIN_BIN_DIRS[@]}"
+ exit 1
+ fi
+ TOOLCHAIN_PATH="${TOOLCHAIN_BIN_DIRS[0]}"
+ fi
+ # Convert to native path for Windows compatibility
+ if [[ "$RUNNER_OS" == "Windows" ]]; then
+ TOOLCHAIN_PATH=$(cygpath -w "$TOOLCHAIN_PATH")
fi
+ echo "$TOOLCHAIN_PATH" >> $GITHUB_PATH
shell: bash
diff --git a/.github/actions/setup_toolchain/toolchain.json b/.github/actions/setup_toolchain/toolchain.json
index 8496dcad3..ee41a5cb4 100644
--- a/.github/actions/setup_toolchain/toolchain.json
+++ b/.github/actions/setup_toolchain/toolchain.json
@@ -2,6 +2,8 @@
"aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v14.2.1-1.1/xpack-arm-none-eabi-gcc-14.2.1-1.1-linux-x64.tar.gz",
+ "arm-gcc-macos-latest": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v14.2.1-1.1/xpack-arm-none-eabi-gcc-14.2.1-1.1-darwin-arm64.tar.gz",
+ "arm-gcc-windows-latest": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v14.2.1-1.1/xpack-arm-none-eabi-gcc-14.2.1-1.1-win32-x64.zip",
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",