Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect host target triple #33

Merged
merged 1 commit into from
Jan 31, 2025
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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ jobs:
- run: ls $HOME/.cargo/bin/ldproxy | grep ldproxy
- run: cargo +esp --version | grep 1.64.0
- run: rustup default | grep stable

check-host-targets:
name: Check host | ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- run: rustup update stable && rustup default stable
- uses: actions/checkout@v3
- uses: ./
name: Install Xtensa Rust
- run: rustc +esp --print target-list | grep xtensa
31 changes: 25 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,29 @@ runs:
curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
fi

- name: Detect host target triple
shell: bash
run: |
export HOST_TARGET=$(rustup show | grep "Default host" | sed -e 's/.* //')
echo "HOST_TARGET=$HOST_TARGET" >> $GITHUB_ENV

- 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"
curl -LO https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${{ env.HOST_TARGET }}.zip
unzip -o ldproxy-${{ env.HOST_TARGET }}.zip -d "$HOME/.cargo/bin"
chmod +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"
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"*

- name: Install Xtensa toolchain
- name: Install Xtensa toolchain (Linux, macOS)
if: env.HOST_TARGET != 'x86_64-pc-windows-msvc'
shell: bash
run: |
source "$HOME/.cargo/env"
Expand All @@ -56,5 +64,16 @@ runs:
source "$HOME/exports"
echo "$PATH" >> "$GITHUB_PATH"
echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV"

- 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

- name: Set default and override
shell: bash
run: |
[[ "${{ inputs.default }}" = true ]] && rustup default esp || true
[[ "${{ inputs.override }}" = true ]] && rustup override unset || true