new: Support custom target dirs. (#19)

This commit is contained in:
Miles Johnson 2024-05-03 12:01:30 -07:00 committed by GitHub
parent c91b4202a2
commit dcab3dcf9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 183 additions and 124 deletions

View file

@ -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

View file

@ -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

View file

@ -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.'
@ -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:

View file

@ -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": {
@ -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"

235
pnpm-lock.yaml generated
View file

@ -6,8 +6,8 @@ settings:
dependencies:
'@actions/cache':
specifier: ^3.2.2
version: 3.2.2
specifier: ^3.2.4
version: 3.2.4
'@actions/core':
specifier: ^1.10.1
version: 1.10.1
@ -27,13 +27,13 @@ dependencies:
specifier: ^1.38.0
version: 1.38.0
detect-libc:
specifier: ^2.0.2
version: 2.0.2
specifier: ^2.0.3
version: 2.0.3
devDependencies:
'@types/node':
specifier: ^20.9.1
version: 20.9.1
specifier: ^20.12.8
version: 20.12.8
'@vercel/ncc':
specifier: ^0.38.1
version: 0.38.1
@ -42,10 +42,10 @@ devDependencies:
version: 8.53.0
eslint-config-moon:
specifier: ^2.0.11
version: 2.0.11(eslint@8.53.0)(typescript@5.2.2)
version: 2.0.11(eslint@8.53.0)(typescript@5.4.5)
prettier:
specifier: ^3.1.0
version: 3.1.0
specifier: ^3.2.5
version: 3.2.5
prettier-config-moon:
specifier: ^1.1.2
version: 1.1.2
@ -53,8 +53,8 @@ devDependencies:
specifier: ^1.3.0
version: 1.3.0
typescript:
specifier: ^5.2.2
version: 5.2.2
specifier: ^5.4.5
version: 5.4.5
packages:
@ -63,17 +63,17 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/@actions/cache@3.2.2:
resolution: {integrity: sha512-6D0Jq5JrLZRQ3VApeQwQkkV20ZZXjXsHNYXd9VjNUdi9E0h93wESpxfMJ2JWLCUCgHNLcfY0v3GjNM+2FdRMlg==}
/@actions/cache@3.2.4:
resolution: {integrity: sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==}
dependencies:
'@actions/core': 1.10.1
'@actions/exec': 1.1.1
'@actions/glob': 0.1.2
'@actions/http-client': 2.2.0
'@actions/http-client': 2.2.1
'@actions/io': 1.1.3
'@azure/abort-controller': 1.1.0
'@azure/ms-rest-js': 2.7.0
'@azure/storage-blob': 12.16.0
'@azure/storage-blob': 12.17.0
semver: 6.3.1
uuid: 3.4.0
transitivePeerDependencies:
@ -83,7 +83,7 @@ packages:
/@actions/core@1.10.1:
resolution: {integrity: sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==}
dependencies:
'@actions/http-client': 2.2.0
'@actions/http-client': 2.2.1
uuid: 8.3.2
dev: false
@ -107,11 +107,11 @@ packages:
minimatch: 3.1.2
dev: false
/@actions/http-client@2.2.0:
resolution: {integrity: sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==}
/@actions/http-client@2.2.1:
resolution: {integrity: sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==}
dependencies:
tunnel: 0.0.6
undici: 5.27.2
undici: 5.28.4
dev: false
/@actions/io@1.1.3:
@ -123,7 +123,7 @@ packages:
dependencies:
'@actions/core': 1.10.1
'@actions/exec': 1.1.1
'@actions/http-client': 2.2.0
'@actions/http-client': 2.2.1
'@actions/io': 1.1.3
semver: 6.3.1
uuid: 3.4.0
@ -136,25 +136,32 @@ packages:
tslib: 2.6.2
dev: false
/@azure/core-auth@1.5.0:
resolution: {integrity: sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==}
engines: {node: '>=14.0.0'}
/@azure/abort-controller@2.1.2:
resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==}
engines: {node: '>=18.0.0'}
dependencies:
'@azure/abort-controller': 1.1.0
'@azure/core-util': 1.6.1
tslib: 2.6.2
dev: false
/@azure/core-http@3.0.3:
resolution: {integrity: sha512-QMib3wXotJMFhHgmJBPUF9YsyErw34H0XDFQd9CauH7TPB+RGcyl9Ayy7iURtJB04ngXhE6YwrQsWDXlSLrilg==}
/@azure/core-auth@1.7.2:
resolution: {integrity: sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==}
engines: {node: '>=18.0.0'}
dependencies:
'@azure/abort-controller': 2.1.2
'@azure/core-util': 1.9.0
tslib: 2.6.2
dev: false
/@azure/core-http@3.0.4:
resolution: {integrity: sha512-Fok9VVhMdxAFOtqiiAtg74fL0UJkt0z3D+ouUUxcRLzZNBioPRAMJFVxiWoJljYpXsRi4GDQHzQHDc9AiYaIUQ==}
engines: {node: '>=14.0.0'}
dependencies:
'@azure/abort-controller': 1.1.0
'@azure/core-auth': 1.5.0
'@azure/core-auth': 1.7.2
'@azure/core-tracing': 1.0.0-preview.13
'@azure/core-util': 1.6.1
'@azure/logger': 1.0.4
'@types/node-fetch': 2.6.9
'@azure/core-util': 1.9.0
'@azure/logger': 1.1.2
'@types/node-fetch': 2.6.11
'@types/tunnel': 0.0.3
form-data: 4.0.0
node-fetch: 2.7.0
@ -167,19 +174,19 @@ packages:
- encoding
dev: false
/@azure/core-lro@2.5.4:
resolution: {integrity: sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==}
engines: {node: '>=14.0.0'}
/@azure/core-lro@2.7.2:
resolution: {integrity: sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==}
engines: {node: '>=18.0.0'}
dependencies:
'@azure/abort-controller': 1.1.0
'@azure/core-util': 1.6.1
'@azure/logger': 1.0.4
'@azure/abort-controller': 2.1.2
'@azure/core-util': 1.9.0
'@azure/logger': 1.1.2
tslib: 2.6.2
dev: false
/@azure/core-paging@1.5.0:
resolution: {integrity: sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==}
engines: {node: '>=14.0.0'}
/@azure/core-paging@1.6.2:
resolution: {integrity: sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==}
engines: {node: '>=18.0.0'}
dependencies:
tslib: 2.6.2
dev: false
@ -188,21 +195,21 @@ packages:
resolution: {integrity: sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==}
engines: {node: '>=12.0.0'}
dependencies:
'@opentelemetry/api': 1.7.0
'@opentelemetry/api': 1.8.0
tslib: 2.6.2
dev: false
/@azure/core-util@1.6.1:
resolution: {integrity: sha512-h5taHeySlsV9qxuK64KZxy4iln1BtMYlNt5jbuEFN3UFSAd1EwKg/Gjl5a6tZ/W8t6li3xPnutOx7zbDyXnPmQ==}
engines: {node: '>=16.0.0'}
/@azure/core-util@1.9.0:
resolution: {integrity: sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==}
engines: {node: '>=18.0.0'}
dependencies:
'@azure/abort-controller': 1.1.0
'@azure/abort-controller': 2.1.2
tslib: 2.6.2
dev: false
/@azure/logger@1.0.4:
resolution: {integrity: sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==}
engines: {node: '>=14.0.0'}
/@azure/logger@1.1.2:
resolution: {integrity: sha512-l170uE7bsKpIU6B/giRc9i4NI0Mj+tANMMMxf7Zi/5cKzEqPayP7+X1WPrG7e+91JgY8N+7K7nF2WOi7iVhXvg==}
engines: {node: '>=18.0.0'}
dependencies:
tslib: 2.6.2
dev: false
@ -210,7 +217,7 @@ packages:
/@azure/ms-rest-js@2.7.0:
resolution: {integrity: sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==}
dependencies:
'@azure/core-auth': 1.5.0
'@azure/core-auth': 1.7.2
abort-controller: 3.0.0
form-data: 2.5.1
node-fetch: 2.7.0
@ -222,16 +229,16 @@ packages:
- encoding
dev: false
/@azure/storage-blob@12.16.0:
resolution: {integrity: sha512-jz33rUSUGUB65FgYrTRgRDjG6hdPHwfvHe+g/UrwVG8MsyLqSxg9TaW7Yuhjxu1v1OZ5xam2NU6+IpCN0xJO8Q==}
/@azure/storage-blob@12.17.0:
resolution: {integrity: sha512-sM4vpsCpcCApagRW5UIjQNlNylo02my2opgp0Emi8x888hZUvJ3dN69Oq20cEGXkMUWnoCrBaB0zyS3yeB87sQ==}
engines: {node: '>=14.0.0'}
dependencies:
'@azure/abort-controller': 1.1.0
'@azure/core-http': 3.0.3
'@azure/core-lro': 2.5.4
'@azure/core-paging': 1.5.0
'@azure/core-http': 3.0.4
'@azure/core-lro': 2.7.2
'@azure/core-paging': 1.6.2
'@azure/core-tracing': 1.0.0-preview.13
'@azure/logger': 1.0.4
'@azure/logger': 1.1.2
events: 3.3.0
tslib: 2.6.2
transitivePeerDependencies:
@ -304,8 +311,8 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@fastify/busboy@2.0.0:
resolution: {integrity: sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==}
/@fastify/busboy@2.1.1:
resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==}
engines: {node: '>=14'}
dev: false
@ -367,8 +374,8 @@ packages:
fastq: 1.15.0
dev: true
/@opentelemetry/api@1.7.0:
resolution: {integrity: sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==}
/@opentelemetry/api@1.8.0:
resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==}
engines: {node: '>=8.0.0'}
dev: false
@ -380,15 +387,15 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true
/@types/node-fetch@2.6.9:
resolution: {integrity: sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==}
/@types/node-fetch@2.6.11:
resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==}
dependencies:
'@types/node': 20.9.1
'@types/node': 20.12.8
form-data: 4.0.0
dev: false
/@types/node@20.9.1:
resolution: {integrity: sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA==}
/@types/node@20.12.8:
resolution: {integrity: sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w==}
dependencies:
undici-types: 5.26.5
@ -403,10 +410,10 @@ packages:
/@types/tunnel@0.0.3:
resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==}
dependencies:
'@types/node': 20.9.1
'@types/node': 20.12.8
dev: false
/@typescript-eslint/eslint-plugin@6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2):
/@typescript-eslint/eslint-plugin@6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
@ -418,10 +425,10 @@ packages:
optional: true
dependencies:
'@eslint-community/regexpp': 4.10.0
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
'@typescript-eslint/scope-manager': 6.10.0
'@typescript-eslint/type-utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/type-utils': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 6.10.0
debug: 4.3.4
eslint: 8.53.0
@ -429,13 +436,13 @@ packages:
ignore: 5.2.4
natural-compare: 1.4.0
semver: 7.5.4
ts-api-utils: 1.0.3(typescript@5.2.2)
typescript: 5.2.2
ts-api-utils: 1.0.3(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser@6.10.0(eslint@8.53.0)(typescript@5.2.2):
/@typescript-eslint/parser@6.10.0(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
@ -447,11 +454,11 @@ packages:
dependencies:
'@typescript-eslint/scope-manager': 6.10.0
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2)
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 6.10.0
debug: 4.3.4
eslint: 8.53.0
typescript: 5.2.2
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
@ -472,7 +479,7 @@ packages:
'@typescript-eslint/visitor-keys': 6.10.0
dev: true
/@typescript-eslint/type-utils@6.10.0(eslint@8.53.0)(typescript@5.2.2):
/@typescript-eslint/type-utils@6.10.0(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
@ -482,12 +489,12 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2)
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.4.5)
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
debug: 4.3.4
eslint: 8.53.0
ts-api-utils: 1.0.3(typescript@5.2.2)
typescript: 5.2.2
ts-api-utils: 1.0.3(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
@ -502,7 +509,7 @@ packages:
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2):
/@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5):
resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -517,13 +524,13 @@ packages:
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
tsutils: 3.21.0(typescript@5.2.2)
typescript: 5.2.2
tsutils: 3.21.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/typescript-estree@6.10.0(typescript@5.2.2):
/@typescript-eslint/typescript-estree@6.10.0(typescript@5.4.5):
resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
@ -538,13 +545,13 @@ packages:
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
ts-api-utils: 1.0.3(typescript@5.2.2)
typescript: 5.2.2
ts-api-utils: 1.0.3(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/utils@5.62.0(eslint@8.53.0)(typescript@5.2.2):
/@typescript-eslint/utils@5.62.0(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -555,7 +562,7 @@ packages:
'@types/semver': 7.5.5
'@typescript-eslint/scope-manager': 5.62.0
'@typescript-eslint/types': 5.62.0
'@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2)
'@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5)
eslint: 8.53.0
eslint-scope: 5.1.1
semver: 7.5.4
@ -564,7 +571,7 @@ packages:
- typescript
dev: true
/@typescript-eslint/utils@6.10.0(eslint@8.53.0)(typescript@5.2.2):
/@typescript-eslint/utils@6.10.0(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
@ -575,7 +582,7 @@ packages:
'@types/semver': 7.5.5
'@typescript-eslint/scope-manager': 6.10.0
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2)
'@typescript-eslint/typescript-estree': 6.10.0(typescript@5.4.5)
eslint: 8.53.0
semver: 7.5.4
transitivePeerDependencies:
@ -966,8 +973,8 @@ packages:
engines: {node: '>=6'}
dev: true
/detect-libc@2.0.2:
resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==}
/detect-libc@2.0.3:
resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==}
engines: {node: '>=8'}
dev: false
@ -1124,21 +1131,21 @@ packages:
semver: 6.3.1
dev: true
/eslint-config-moon@2.0.11(eslint@8.53.0)(typescript@5.2.2):
/eslint-config-moon@2.0.11(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-uDaKPcbX4M53ydoyHieIPAbEawAwLwet0UlJDgyw/Ljg+yuysv8zkAj4Vx4P/6xW93VzgQRDolDRhitAeHsYHQ==}
engines: {node: '>=16.12.0'}
peerDependencies:
eslint: ^8.0.0
dependencies:
'@moonrepo/dev': 2.0.1
'@typescript-eslint/eslint-plugin': 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/eslint-plugin': 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.4.5)
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
eslint: 8.53.0
eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.0)(eslint@8.53.0)
eslint-config-prettier: 9.0.0(eslint@8.53.0)
eslint-plugin-compat: 4.2.0(eslint@8.53.0)
eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)
eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.10.0)(eslint@8.53.0)(typescript@5.2.2)
eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.10.0)(eslint@8.53.0)(typescript@5.4.5)
eslint-plugin-jsx-a11y: 6.8.0(eslint@8.53.0)
eslint-plugin-node: 11.1.0(eslint@8.53.0)
eslint-plugin-promise: 6.1.1(eslint@8.53.0)
@ -1146,7 +1153,7 @@ packages:
eslint-plugin-react-hooks: 4.6.0(eslint@8.53.0)
eslint-plugin-react-perf: 3.3.1(eslint@8.53.0)
eslint-plugin-simple-import-sort: 10.0.0(eslint@8.53.0)
eslint-plugin-solid: 0.13.0(eslint@8.53.0)(typescript@5.2.2)
eslint-plugin-solid: 0.13.0(eslint@8.53.0)(typescript@5.4.5)
eslint-plugin-unicorn: 48.0.1(eslint@8.53.0)
transitivePeerDependencies:
- eslint-import-resolver-typescript
@ -1196,7 +1203,7 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
debug: 3.2.7
eslint: 8.53.0
eslint-import-resolver-node: 0.3.9
@ -1241,7 +1248,7 @@ packages:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
array-includes: 3.1.7
array.prototype.findlastindex: 1.2.3
array.prototype.flat: 1.3.2
@ -1266,7 +1273,7 @@ packages:
- supports-color
dev: true
/eslint-plugin-jest@27.6.0(@typescript-eslint/eslint-plugin@6.10.0)(eslint@8.53.0)(typescript@5.2.2):
/eslint-plugin-jest@27.6.0(@typescript-eslint/eslint-plugin@6.10.0)(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-MTlusnnDMChbElsszJvrwD1dN3x6nZl//s4JD23BxB6MgR66TZlL064su24xEIS3VACfAoHV1vgyMgPw8nkdng==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
peerDependencies:
@ -1279,8 +1286,8 @@ packages:
jest:
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/eslint-plugin': 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.4.5)
'@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@5.4.5)
eslint: 8.53.0
transitivePeerDependencies:
- supports-color
@ -1387,13 +1394,13 @@ packages:
eslint: 8.53.0
dev: true
/eslint-plugin-solid@0.13.0(eslint@8.53.0)(typescript@5.2.2):
/eslint-plugin-solid@0.13.0(eslint@8.53.0)(typescript@5.4.5):
resolution: {integrity: sha512-Sutd+DxEGu9+Z9ITtHKXRAClxVe1a6C1XQZSuN8iBsMy0IAVEc6Tca1UYgc7tD2ZrRRjZKB9mohBOaZl5NJLgg==}
engines: {node: '>=12.0.0'}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.4.5)
eslint: 8.53.0
is-html: 2.0.0
jsx-ast-utils: 3.3.5
@ -2486,8 +2493,8 @@ packages:
resolution: {integrity: sha512-zShTjMXH4GlracR3jllxsYJGlYAh5w75TZUuFW6YG75unimMMCNfkWY6EbI5nqr4T+xhb81rDMq2m5YxopBfiQ==}
dev: true
/prettier@3.1.0:
resolution: {integrity: sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==}
/prettier@3.2.5:
resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==}
engines: {node: '>=14'}
hasBin: true
dev: true
@ -2837,13 +2844,13 @@ packages:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: false
/ts-api-utils@1.0.3(typescript@5.2.2):
/ts-api-utils@1.0.3(typescript@5.4.5):
resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==}
engines: {node: '>=16.13.0'}
peerDependencies:
typescript: '>=4.2.0'
dependencies:
typescript: 5.2.2
typescript: 5.4.5
dev: true
/tsconfig-moon@1.3.0:
@ -2866,14 +2873,14 @@ packages:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
dev: false
/tsutils@3.21.0(typescript@5.2.2):
/tsutils@3.21.0(typescript@5.4.5):
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: 1.14.1
typescript: 5.2.2
typescript: 5.4.5
dev: true
/tunnel@0.0.6:
@ -2941,8 +2948,8 @@ packages:
is-typed-array: 1.1.12
dev: true
/typescript@5.2.2:
resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==}
/typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
hasBin: true
dev: true
@ -2959,11 +2966,11 @@ packages:
/undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
/undici@5.27.2:
resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==}
/undici@5.28.4:
resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==}
engines: {node: '>=14.0'}
dependencies:
'@fastify/busboy': 2.0.0
'@fastify/busboy': 2.1.1
dev: false
/update-browserslist-db@1.0.13(browserslist@4.22.1):

View file

@ -18,12 +18,22 @@ export function getCacheTarget(): string {
return core.getInput('cache-target') || 'debug';
}
export function getTargetPaths(): string[] {
const profile = getCacheTarget();
const dirs = core.getInput('target-dirs', { required: true }).split(',');
return dirs
.map((dir) => dir.trim())
.filter(Boolean)
.map((dir) => path.join(WORKSPACE_ROOT, dir, profile));
}
export function getCachePaths(): string[] {
return [
// ~/.cargo/registry
path.join(CARGO_HOME, 'registry'),
// /workspace/target/debug
path.join(WORKSPACE_ROOT, 'target', getCacheTarget()),
...getTargetPaths(),
];
}

View file

@ -165,12 +165,33 @@ export async function saveCache() {
return;
}
const cachePaths = getCachePaths().filter((cachePath) => {
if (!fs.existsSync(cachePath)) {
core.info(`Cache path ${cachePath} does not exist, skipping`);
return false;
}
return true;
});
if (cachePaths.length === 0) {
core.info('No paths to cache, skipping save entirely');
return;
}
await cleanCargoRegistry();
await cleanTargetProfile();
core.info(`Saving cache with key ${primaryKey}`);
await cache.saveCache(getCachePaths(), primaryKey);
core.debug(`Cache key: ${primaryKey}`);
core.debug('Cache paths:');
for (const cachePath of cachePaths) {
core.debug(`- ${cachePath}`);
}
await cache.saveCache(cachePaths, primaryKey);
}
export async function restoreCache() {
@ -181,6 +202,15 @@ export async function restoreCache() {
core.info('Attempting to restore cache');
const primaryKey = await getPrimaryCacheKey();
const cachePaths = getCachePaths();
core.debug(`Cache key: ${primaryKey}`);
core.debug('Cache paths:');
for (const cachePath of cachePaths) {
core.debug(`- ${cachePath}`);
}
const cacheKey = await cache.restoreCache(getCachePaths(), primaryKey, getCachePrefixes());
if (cacheKey) {