Skip to content

Commit

Permalink
feat: Detect host target triple
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jan 31, 2025
1 parent c403dc7 commit 7d40b2b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
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

0 comments on commit 7d40b2b

Please sign in to comment.