name: Download Toolchain inputs: toolchain: description: 'Toolchain name' required: true toolchain_url: description: 'Toolchain URL' required: true runs: using: "composite" steps: - name: Cache Toolchain if: ${{ !startsWith(inputs.toolchain_url, 'https://github.com') }} uses: actions/cache@v4 id: cache-toolchain-download with: path: ~/cache/${{ inputs.toolchain }} key: ${{ runner.os }}-${{ inputs.toolchain }}-${{ inputs.toolchain_url }} - 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/${TOOLCHAIN} if [[ ${TOOLCHAIN} == rx-gcc ]]; then wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.run chmod +x toolchain.run ./toolchain.run -p ~/cache/${TOOLCHAIN}/gnurx -y 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 wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar.gz tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar.gz fi shell: bash - name: Setup Toolchain env: TOOLCHAIN: ${{ inputs.toolchain }} run: | 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" else echo >> $GITHUB_PATH `echo ~/cache/${TOOLCHAIN}/*/bin` fi shell: bash