-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
2 changed files
with
49 additions
and
2 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,46 @@ | ||
--- | ||
name: "NPM Cache Action" | ||
description: "Initialize NPM Cache" | ||
inputs: | ||
nodeModulesPath: | ||
description: "Path for node_modules" | ||
required: false | ||
default: "**node_modules" | ||
packageLockPath: | ||
description: "Path for package-lock.json" | ||
required: false | ||
default: "**/package-lock.json" | ||
nodeVersion: | ||
description: "Node version" | ||
required: false | ||
default: "20" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: π Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
cache-dependency-path: screen-reader-test/package-lock.json | ||
|
||
- name: Display node and npm version | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
- name: π Init Cache | ||
uses: actions/cache@v4 | ||
id: "cache" | ||
with: | ||
path: ${{ inputs.nodeModulesPath }} | ||
key: ${{ runner.os }}-node-${{ inputs.nodeVersion }}-${{ hashFiles(inputs.packageLockPath) }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ inputs.nodeVersion }} | ||
- name: β¬ NPM ci | ||
shell: bash | ||
working-directory: screen-reader-test | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
npm ci |
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