summaryrefslogtreecommitdiff
path: root/.github/actions/setup_toolchain
diff options
context:
space:
mode:
Diffstat (limited to '.github/actions/setup_toolchain')
-rw-r--r--.github/actions/setup_toolchain/action.yml24
-rw-r--r--.github/actions/setup_toolchain/download/action.yml57
-rw-r--r--.github/actions/setup_toolchain/espressif/action.yml18
-rw-r--r--.github/actions/setup_toolchain/toolchain.json5
4 files changed, 69 insertions, 35 deletions
diff --git a/.github/actions/setup_toolchain/action.yml b/.github/actions/setup_toolchain/action.yml
index 6fd5c9d4e..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,20 +20,18 @@ 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 }}
run: |
- TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
+ TOOLCHAIN_URL=$(jq -r --arg tc "$TOOLCHAIN" '.[$tc]' .github/actions/setup_toolchain/toolchain.json)
echo "toolchain_url=$TOOLCHAIN_URL"
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
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 }}
@@ -47,11 +39,13 @@ runs:
- name: Set toolchain option
id: set-toolchain-option
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
BUILD_OPTION=""
- if [[ "${{ inputs.toolchain }}" == *"clang"* ]]; then
+ if [[ "$TOOLCHAIN" == *"clang"* ]]; then
BUILD_OPTION="--toolchain clang"
- elif [[ "${{ inputs.toolchain }}" == "arm-iar" ]]; then
+ elif [[ "$TOOLCHAIN" == "arm-iar" ]]; then
BUILD_OPTION="--toolchain iar"
fi
echo "build_option=$BUILD_OPTION"
diff --git a/.github/actions/setup_toolchain/download/action.yml b/.github/actions/setup_toolchain/download/action.yml
index ce9643010..77d3bcf19 100644
--- a/.github/actions/setup_toolchain/download/action.yml
+++ b/.github/actions/setup_toolchain/download/action.yml
@@ -13,7 +13,7 @@ runs:
steps:
- name: Cache Toolchain
if: ${{ !startsWith(inputs.toolchain_url, 'https://github.com') }}
- uses: actions/cache@v4
+ uses: actions/cache@v5
id: cache-toolchain-download
with:
path: ~/cache/${{ inputs.toolchain }}
@@ -21,27 +21,58 @@ runs:
- name: Install Toolchain
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
+ TOOLCHAIN_URL: ${{ inputs.toolchain_url }}
run: |
- mkdir -p ~/cache/${{ inputs.toolchain }}
+ mkdir -p ~/cache/${TOOLCHAIN}
+ FILE_EXT="${TOOLCHAIN_URL##*.}"
- if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
+ if [[ ${TOOLCHAIN} == rx-gcc ]]; then
+ wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.run
chmod +x toolchain.run
- ./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
- elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
+ ./toolchain.run -p ~/cache/${TOOLCHAIN}/gnurx -y
+ elif [[ ${TOOLCHAIN} == ft9xx-gcc ]]; then
+ wget --progress=dot:giga ${TOOLCHAIN_URL} -O ~/cache/${TOOLCHAIN}/ft9xxtoolchain.deb
+ 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
+ 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
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
- tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
+ echo "Unsupported toolchain file extension: ${FILE_EXT}"
+ exit 1
fi
shell: bash
- name: Setup Toolchain
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
- if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
- sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
- echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
+ if [[ ${TOOLCHAIN} == arm-iar ]]; then
+ sudo dpkg -i ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
+ sudo apt install -y ~/cache/${TOOLCHAIN}/cxarm.deb
+ TOOLCHAIN_PATH="/opt/iar/cxarm/arm/bin"
+ elif [[ ${TOOLCHAIN} == ft9xx-gcc ]]; then
+ sudo apt install -y ~/cache/${TOOLCHAIN}/ft9xxtoolchain.deb
+ TOOLCHAIN_PATH="/opt/ft32/bin"
else
- echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.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/espressif/action.yml b/.github/actions/setup_toolchain/espressif/action.yml
index b50ffd41d..ec1ff2e91 100644
--- a/.github/actions/setup_toolchain/espressif/action.yml
+++ b/.github/actions/setup_toolchain/espressif/action.yml
@@ -7,19 +7,21 @@ inputs:
toolchain_version:
description: 'Toolchain version'
required: false
- default: 'v5.3.2'
+ default: 'v5.5.3'
runs:
using: "composite"
steps:
- name: Set DOCKER_ESP_IDF
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
- DOCKER_ESP_IDF=$HOME/cache/${{ inputs.toolchain }}/docker_image.tar
+ DOCKER_ESP_IDF=$HOME/cache/${TOOLCHAIN}/docker_image.tar
echo "DOCKER_ESP_IDF=$DOCKER_ESP_IDF" >> $GITHUB_ENV
shell: bash
- name: Cache Docker Image
- uses: actions/cache@v4
+ uses: actions/cache@v5
id: cache-toolchain-espressif
with:
path: ${{ env.DOCKER_ESP_IDF }}
@@ -27,10 +29,12 @@ runs:
- name: Pull and Save Docker Image
if: steps.cache-toolchain-espressif.outputs.cache-hit != 'true'
+ env:
+ TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
run: |
- docker pull espressif/idf:${{ inputs.toolchain_version }}
+ docker pull espressif/idf:${TOOLCHAIN_VERSION}
mkdir -p $(dirname $DOCKER_ESP_IDF)
- docker save -o $DOCKER_ESP_IDF espressif/idf:${{ inputs.toolchain_version }}
+ docker save -o $DOCKER_ESP_IDF espressif/idf:${TOOLCHAIN_VERSION}
du -sh $DOCKER_ESP_IDF
shell: bash
@@ -42,7 +46,9 @@ runs:
shell: bash
- name: Tag Local Image
+ env:
+ TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
run: |
- docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
+ docker tag espressif/idf:${TOOLCHAIN_VERSION} espressif/idf:tinyusb
docker images
shell: bash
diff --git a/.github/actions/setup_toolchain/toolchain.json b/.github/actions/setup_toolchain/toolchain.json
index f7123ef11..85c746356 100644
--- a/.github/actions/setup_toolchain/toolchain.json
+++ b/.github/actions/setup_toolchain/toolchain.json
@@ -2,8 +2,11 @@
"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",
+ "ft9xx-gcc": "https://github.com/Bridgetek/ft32-toolchain-linux/releases/download/v2.7.6/ft9xxtoolchain_2.7.6_amd64.deb",
+ "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",
- "arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
+ "arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/723/cxarm-9.70.1.deb"
}