-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathaction.yaml
60 lines (54 loc) · 1.99 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Rust Toolchain for Xtensa
description: Install the Rust compiler fork targeting Xtensa devices
author: esp-rs
branding:
icon: play-circle
color: red
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
ldproxy:
description: Whether to install ldproxy (required for `std`)
default: true
override:
description: Whether to override the toolchain
default: true
runs:
using: composite
steps:
- name: Ensure that Rust is already installed
shell: bash
run: |
if [ ! -d "$HOME/.cargo/bin" ]; then
curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
fi
- name: Install ldproxy
if: inputs.ldproxy == 'true'
shell: bash
run: |
curl -LO https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip
unzip -o ldproxy-x86_64-unknown-linux-gnu.zip -d "$HOME/.cargo/bin"
chmod a+x "$HOME/.cargo/bin/ldproxy"
- name: Install espup
shell: bash
run: |
curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-unknown-linux-gnu -o "$HOME/.cargo/bin/espup"
chmod a+x "$HOME/.cargo/bin/espup"
- name: Install Xtensa toolchain
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
source "$HOME/exports"
echo "$PATH" >> "$GITHUB_PATH"
echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV"
[[ "${{ inputs.default }}" = true ]] && rustup default esp || true
[[ "${{ inputs.override }}" = true ]] && rustup override unset || true