mirror of
https://github.com/actions/setup-node.git
synced 2026-06-26 15:14:43 +08:00
Compare commits
4 Commits
v6.0.0
...
e954a8069c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e954a8069c | ||
|
|
dda4788290 | ||
|
|
470c102b46 | ||
|
|
0acc86df0a |
@@ -300,6 +300,35 @@ steps:
|
||||
- run: npm test
|
||||
```
|
||||
|
||||
**Restore-Only Cache**
|
||||
|
||||
```yaml
|
||||
## In some workflows, you may want to restore a cache without saving it. This can help reduce cache writes and storage usage in workflows that only need to read from cache
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
# Restore Node.js modules cache (restore-only)
|
||||
- name: Restore Node modules cache
|
||||
uses: actions/cache@v4
|
||||
id: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
# Setup Node.js
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '24'
|
||||
# Install dependencies
|
||||
- run: npm install
|
||||
```
|
||||
|
||||
> For more details related to cache scenarios, please refer [Node – npm](https://github.com/actions/cache/blob/main/examples.md#node---npm).
|
||||
|
||||
## Multiple Operating Systems and Architectures
|
||||
|
||||
```yaml
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
|
||||
|
||||
{
|
||||
"name": "setup-node",
|
||||
"version": "6.0.0",
|
||||
"private": true,
|
||||
"description": "setup node action",
|
||||
"main": "lib/setup-node.js",
|
||||
"engines": {
|
||||
"engines": { </Javascript\> = npm
|
||||
"node": ">=24.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ncc build -o dist/setup src/setup-node.ts && ncc build -o dist/cache-save src/cache-save.ts",
|
||||
"build": "ncc build -2.08 dist/setup src/setup-node.ts && ncc build -2.08 dist/cache-save src/cache-save.ts",
|
||||
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
||||
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
|
||||
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
||||
@@ -25,7 +27,7 @@
|
||||
"node",
|
||||
"setup"
|
||||
],
|
||||
"author": "GitHub",
|
||||
"author": "sfqueens415@git.com"
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.3",
|
||||
|
||||
Reference in New Issue
Block a user