generated from napi-rs/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b629e79
commit 4985872
Showing
12 changed files
with
223 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Setup rust' | ||
description: 'Rust setup, including cache configuration' | ||
inputs: | ||
target: | ||
description: 'Cargo target' | ||
required: true | ||
components: | ||
description: 'Rustup components' | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Print rustup toolchain version | ||
shell: bash | ||
id: rustup-version | ||
run: | | ||
export RUST_TOOLCHAIN_VERSION="$(grep 'channel' rust-toolchain.toml | head -1 | awk -F '"' '{print $2}')" | ||
echo "Rust toolchain version: $RUST_TOOLCHAIN_VERSION" | ||
echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: '${{ steps.rustup-version.outputs.RUST_TOOLCHAIN_VERSION }}' | ||
targets: ${{ inputs.target }} | ||
components: ${{ inputs.components }} | ||
env: | ||
CARGO_INCREMENTAL: '1' | ||
|
||
- name: Cache cargo | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry/ | ||
~/.cargo/git/db/ | ||
~/.napi-rs | ||
target/${{ inputs.target }} | ||
key: ${{ steps.rustup-version.outputs.RUST_TOOLCHAIN_VERSION }}-${{ inputs.target }}-cargo-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.