-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): bring examples into npm workspace (#1434)
* chore: added cdkk example to workspace * chore: added sam example to workspace * chore: update setup-local script * chore: ignored lock + removed version command * chore: update version command & moved definition to main package.json * chore: fixed cache key for examples * chore: bumped versions in sam example * chore: extracted node-cache steps * chore: extracted node-cache steps * chore: adapted custom action to all workflows * chore: fixed input
- Loading branch information
1 parent
160f539
commit 27ca202
Showing
17 changed files
with
188 additions
and
27,253 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,36 @@ | ||
name: 'Cached Node Modules' | ||
description: 'A simple action to cache node_modules or install them if they are not cached' | ||
inputs: | ||
nodeVersion: # id of input | ||
description: 'Node.js version to use in the cache key' | ||
default: '18' | ||
outputs: | ||
cache-hit: | ||
description: "Whether the cache was hit or not" | ||
value: ${{ steps.cache-node-modules.outputs.cache-hit }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache node modules | ||
id: cache-node-modules | ||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 | ||
with: | ||
path: "./node_modules" | ||
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that | ||
# if one of them changes the cache is invalidated/discarded | ||
key: ${{ inputs.nodeVersion }}-cache-utilities-node-modules-${{ hashFiles('./package-lock.json') }} | ||
- name: Install dependencies | ||
# We can skip the installation if there was a cache hit | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts | ||
run: npm ci --foreground-scripts | ||
shell: bash | ||
- name: Build packages | ||
# If there's a cache hit we still need to manually build the packages | ||
# this would otherwise have been done automatically as a part of the | ||
# post-install npm hook | ||
if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
run: | | ||
npm run build -w packages/commons | ||
npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics & npm run build -w packages/parameters & npm run build -w packages/idempotency | ||
shell: bash |
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
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.