Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ This action can be configured in various ways using its inputs:
| `version` | Which version of the toolchain to install | string | _latest_ |
| `ldproxy` | Whether to install `ldproxy` (required for `std`) | bool | `true` |
| `override` | Overrides the installed toolchain | bool | `true` |
| `export` | Sources `${ESPUP_EXPORT_FILE}` | bool | `true` |

All inputs are optional; if no inputs are provided:

Expand Down
14 changes: 10 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
override:
description: Whether to override the toolchain
default: true
export:
description: Whether to export the `${ESPUP_EXPORT_FILE}` into the GitHub environment
default: true

runs:
using: composite
Expand Down Expand Up @@ -55,24 +58,27 @@ runs:
curl -LO https://github.com/esp-rs/espup/releases/latest/download/espup-${{ env.HOST_TARGET }}.zip
unzip -o espup-${{ env.HOST_TARGET }}.zip -d "$HOME/.cargo/bin"
chmod +x "$HOME/.cargo/bin/espup"*
echo "ESPUP_EXPORT_FILE=$HOME/exports" >> $GITHUB_ENV

- name: Install Xtensa toolchain (Linux, macOS)
if: env.HOST_TARGET != 'x86_64-pc-windows-msvc'
shell: bash
run: |
source "$HOME/.cargo/env"
[[ "${{ inputs.version }}" != latest ]] && version="--toolchain-version ${{ inputs.version }}" || version=""
"$HOME/.cargo/bin/espup" install -l debug --export-file $HOME/exports --targets ${{ inputs.buildtargets }} $version
"$HOME/.cargo/bin/espup" install -l debug --targets ${{ inputs.buildtargets }} $version
source "$HOME/exports"
echo "$PATH" >> "$GITHUB_PATH"
echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV"
if [[ "${{ inputs.export }}" = true ]]; then
echo "$PATH" >> "$GITHUB_PATH"
echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV"
fi

- name: Install Xtensa toolchain (Windows)
if: env.HOST_TARGET == 'x86_64-pc-windows-msvc'
shell: bash
run: |
[[ "${{ inputs.version }}" != latest ]] && version="--toolchain-version ${{ inputs.version }}" || version=""
"$HOME/.cargo/bin/espup.exe" install -l debug --export-file $HOME/exports --targets ${{ inputs.buildtargets }} $version
"$HOME/.cargo/bin/espup.exe" install -l debug --targets ${{ inputs.buildtargets }} $version

- name: Set default and override
shell: bash
Expand Down