Skip to content

Commit

Permalink
new: Support custom target dirs. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored May 3, 2024
1 parent c91b420 commit dcab3dc
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 124 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.2.0

- Added a `target-dirs` input, allowing the target folders to be specified. Can now cache multiple
target folders.
- Updated to skip caching a directory if it does not exist, instead of failing.
- Updated dependencies.

# 1.1.0

- Added a `cache-base` input. When provided, will only save cache on this branch/ref, but will
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ optional.
- `inherit-toolchain` - Inherit all toolchain settings from the `rust-toolchain.toml` file. Defaults
to `false`.
- `targets` - Comma-separated list of additional targets to install.
- `target-dirs` - Comma-separated list of target folder paths, relative from the repository root.
Defaults to `target`.
- `profile` - Profile to install. Defaults to `minimal`.

## Configuring the Rust toolchain
Expand Down
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
description: 'Comma-separated list of global binaries to install into Cargo.'
cache:
description: 'Toggle caching of ~/.cargo/registry and /target/<cache-target> directories.'
default: true
default: 'true'
cache-base:
description:
'Base branch/ref to save a warmup cache on. Other branches/refs will restore from this base.'
Expand All @@ -21,9 +21,12 @@ inputs:
description: 'Comma-separated list of additional components to install.'
inherit-toolchain:
description: 'Inherit all toolchain settings from the rust-toolchain.toml file.'
default: false
default: 'false'
targets:
description: 'Comma-separated list of additional targets to install.'
target-dirs:
description: 'Comma-separated list of target folder paths, relative from the repository root.'
default: 'target'
profile:
description: 'Profile to install. Defaults to "minimal".'
outputs:
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonrepo/setup-rust",
"version": "1.0.3",
"version": "1.2.0",
"description": "A GitHub action for setting up Rust and Cargo.",
"main": "dist/index.js",
"scripts": {
Expand All @@ -16,24 +16,24 @@
"author": "Miles Johnson",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.2",
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/glob": "^0.4.0",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@ltd/j-toml": "^1.38.0",
"detect-libc": "^2.0.2"
"detect-libc": "^2.0.3"
},
"devDependencies": {
"@types/node": "^20.9.1",
"@types/node": "^20.12.8",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.53.0",
"eslint-config-moon": "^2.0.11",
"prettier": "^3.1.0",
"prettier": "^3.2.5",
"prettier-config-moon": "^1.1.2",
"tsconfig-moon": "^1.3.0",
"typescript": "^5.2.2"
"typescript": "^5.4.5"
},
"engines": {
"node": ">=20.0.0"
Expand Down
Loading

0 comments on commit dcab3dc

Please sign in to comment.