-
Notifications
You must be signed in to change notification settings - Fork 22
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
4 changed files
with
57 additions
and
77 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,39 @@ | ||
name: Prepare Node | ||
description: Load npm cache, install Node dependencies | ||
|
||
inputs: | ||
install-deps: | ||
description: Whether to run `npm ci`. Set "maybe" to install deps if cache is missing. "yes" by default. | ||
default: "yes" | ||
|
||
ignore-scripts: | ||
description: Whether to run `npm ci` with --ignore-scripts. "yes" by default. | ||
default: "yes" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# Log debug information | ||
- shell: sh -e {0} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eason9487
Author
Member
|
||
run: | | ||
node --version | ||
npm --version | ||
# Get npm cache directory | ||
- uses: actions/cache@v2 | ||
id: npm-cache | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
# Install node dependencies | ||
- shell: sh -e {0} | ||
# Update npm cache directory if package-lock has changed | ||
run: | | ||
if [ "${{ inputs.install-deps }}" = "yes" ] || [ "${{ steps.npm-cache.outputs.cache-hit }}" != "true" ]; then | ||
npm ci `if [ "${{ inputs.ignore-scripts }}" = "yes" ]; then printf %s "--ignore-scripts"; fi` | ||
else | ||
echo "Skip npm ci" | ||
fi |
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
❔
Why do we need this shell entry? We didn't have it few commits before