Skip to content

Commit

Permalink
Make the action work with act (#26)
Browse files Browse the repository at this point in the history
* Make the action work with `act`

* Add notes on using with `act` to the `README`
  • Loading branch information
jessebraham authored Oct 31, 2023
1 parent 57013ae commit 498a93e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ So, we recommend [defining] `GITHUB_TOKEN`, as seen in the [example workflow], w
[defining]: https://docs.github.com/en/actions/learn-github-actions/variables
[example workflow]: #example-workflow

## Use with [act]

[act] is a tool which can be used to run GitHub workflows locally, using Docker. It is possible to use the `xtensa-toolchain` action with [act]; however, due to the fact that [espup] queries the GitHub API, it is necessary to set the `GITHUB_TOKEN` environment variable in order to do so.

For more information please see the [`GITHUB_TOKEN`] section of the `README` for [act].

[act]: https://github.com/nektos/act
[`GITHUB_TOKEN`]: https://github.com/nektos/act#github_token

## License

Licensed under either of:
Expand Down
26 changes: 18 additions & 8 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,35 @@ inputs:
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 -L https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip -o $HOME/.cargo/bin/ldproxy.zip
unzip "$HOME/.cargo/bin/ldproxy.zip" -d "$HOME/.cargo/bin/"
chmod a+x $HOME/.cargo/bin/ldproxy
curl -LO https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip
unzip 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
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
"$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"
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

0 comments on commit 498a93e

Please sign in to comment.