-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚦 Add composite action for caching cargo installs
The `cargo install` commands are taking quite a while due to it producing long build-times. This adds a caching mechanism to keep the dependencies between builds so that installation times don't have to suffer.
- Loading branch information
1 parent
d370c2e
commit 36119cc
Showing
4 changed files
with
56 additions
and
6 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,29 @@ | ||
name: cargo-install | ||
description: "Performs a cargo install for the specified component, with caching" | ||
|
||
inputs: | ||
target: | ||
required: true | ||
description: "The component to install" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache installation | ||
id: cargo-install | ||
uses: actions/cache@v3 | ||
with: | ||
path: .cargo/bin/${{ inputs.target }} | ||
key: cargo-install-${{ inputs.target }} | ||
|
||
- name: Update git submodules | ||
if: steps.cargo-install.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
mkdir -p .cargo/bin | ||
cargo install --locked ${{ inputs.target }} --root ./.cargo | ||
- name: Update PATH | ||
shell: bash | ||
run: | | ||
echo "$(pwd)/.cargo/bin" >> "${GITHUB_PATH}" |
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
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
/Cargo.lock | ||
/.cargo |