Skip to content

Commit

Permalink
Allow specifying buildtargets
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro authored and jessebraham committed May 30, 2022
1 parent 4705a90 commit 627519f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ jobs:
## Inputs
| Name | Description | Type | Default |
| :-------: | :-----------------------------------------------: | :----: | :------: |
| `default` | Set installed toolchain as a default toolchain | bool | `false` |
| `version` | Which version of the toolchain to install | string | _latest_ |
| `ldproxy` | Whether to install `ldproxy` (required for `std`) | bool | `true` |
| Name | Description | Type | Default |
| :-------: | :-----------------------------------------------: | :----: | :------: |
| `default` | Set installed toolchain as a default toolchain | bool | `false` |
| `buildtargets` | Comma separated list of targets | bool | `all` |
| `version` | Which version of the toolchain to install | string | _latest_ |
| `ldproxy` | Whether to install `ldproxy` (required for `std`) | bool | `true` |

All inputs are optional; if no inputs are provided:

- the Rust compiler fork with Xtensa support will **NOT** be set as the default (but is usable via the `+esp` toolchain specifier)
- all available build targets will be installed
- the latest available version of the compiler will be installed
- [ldproxy](https://github.com/ivmarkov/embuild) **WILL** be installed; this is required for `std`, however installing it significantly increases the total run time of this action

Expand Down
5 changes: 4 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
default:
description: Set installed toolchain as default
default: false
buildtargets:
description: Comma separated list of targets
default: all
version:
description: Which version of the toolchain to install
default: latest
Expand All @@ -30,6 +33,6 @@ runs:
shell: bash
run: |
[[ "${{ inputs.ldproxy }}" = true ]] && crates="ldproxy" || crates=""
${{ github.action_path }}/install.sh "$crates" ${{ inputs.version }}
${{ github.action_path }}/install.sh "$crates" ${{ inputs.version }} ${{ inputs.buildtargets }}
[[ "${{ inputs.default }}" = true ]] && rustup default esp || true
rustup override unset
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function check_version_formatting() {

crates="${1:-}"
version="${2:-latest}"
buildtargets="${3:-all}"

curl -LO https://raw.githubusercontent.com/esp-rs/rust-build/main/install-rust-toolchain.sh
chmod +x ./install-rust-toolchain.sh
Expand All @@ -42,7 +43,7 @@ case $version in

*)
check_version_formatting "$version"
install_rust_toolchain --toolchain-version "$version"
install_rust_toolchain --toolchain-version "$version" --build-target "${buildtargets}"
;;
esac

Expand Down

0 comments on commit 627519f

Please sign in to comment.