diff --git a/.github/actions/cached-node-modules/action.yml b/.github/actions/cached-node-modules/action.yml deleted file mode 100644 index 08973b3795..0000000000 --- a/.github/actions/cached-node-modules/action.yml +++ /dev/null @@ -1,48 +0,0 @@ -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: '20' - build: - description: 'Whether to build the packages or not' - default: 'true' -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@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - 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' - run: npm ci - shell: bash - - name: Build packages - # Regardless of whether the cache was hit or not, we need to build the packages, unless the caller says otherwise - if: inputs.build == 'true' - # We build the commons and jmspath packages first, then the others in parallel to speed up the process - # even though we could just run `npm run build` in the root folder and build them in - # sequence, but still in the correct order. - run: | - npm run build -w packages/commons - npm run build -w packages/jmespath - 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 & \ - npm run build -w packages/batch & \ - npm run build -w packages/testing & \ - npm run build -w packages/parser & \ - npm run build -w packages/event-handler - shell: bash \ No newline at end of file diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 9a08893c55..4fd8000298 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -57,7 +57,7 @@ jobs: run: | npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Publish to npm run: | NPM_CONFIG_PROVENANCE=true npx lerna publish from-package --git-head ${{ github.sha }} --yes diff --git a/.github/workflows/make-version.yml b/.github/workflows/make-version.yml index 47aac1640d..b1297b465d 100644 --- a/.github/workflows/make-version.yml +++ b/.github/workflows/make-version.yml @@ -28,7 +28,7 @@ jobs: node-version: "20" cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Version id: bump-version run: npx lerna version --conventional-commits --no-git-tag-version --no-push --no-commit-hooks --yes diff --git a/.github/workflows/publish_layer.yml b/.github/workflows/publish_layer.yml index b71b0295aa..f867b1d65f 100644 --- a/.github/workflows/publish_layer.yml +++ b/.github/workflows/publish_layer.yml @@ -39,7 +39,7 @@ jobs: with: node-version: "20" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: CDK build run: npm run cdk -w layers -- synth --context PowertoolsPackageVersion=${{ inputs.latest_published_version }} -o cdk.out - name: Zip output diff --git a/.github/workflows/reusable-run-linting-check-and-unit-tests.yml b/.github/workflows/reusable-run-linting-check-and-unit-tests.yml index 8edb8c6aca..65f53b6d57 100644 --- a/.github/workflows/reusable-run-linting-check-and-unit-tests.yml +++ b/.github/workflows/reusable-run-linting-check-and-unit-tests.yml @@ -24,7 +24,7 @@ jobs: node-version: ${{ matrix.version }} cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 with: nodeVersion: ${{ matrix.version }} - name: Run linting @@ -71,7 +71,7 @@ jobs: node-version: 20 cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Run linting run: npm run lint - name: Run tests @@ -89,7 +89,7 @@ jobs: node-version: 20 cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Run linting run: npm run lint -w layers - name: Run tests @@ -107,7 +107,7 @@ jobs: node-version: 20 cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Run linting run: npm run lint -w examples/snippets check-docs: @@ -123,6 +123,6 @@ jobs: node-version: 20 cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Run linting run: npm run lint:markdown diff --git a/.github/workflows/reusable_deploy_layer_stack.yml b/.github/workflows/reusable_deploy_layer_stack.yml index 907475d8cd..25fe2ccbdb 100644 --- a/.github/workflows/reusable_deploy_layer_stack.yml +++ b/.github/workflows/reusable_deploy_layer_stack.yml @@ -74,7 +74,7 @@ jobs: with: node-version: "20" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Download artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: diff --git a/.github/workflows/reusable_publish_docs.yml b/.github/workflows/reusable_publish_docs.yml index 1bcfdcbb7e..15eae8f37d 100644 --- a/.github/workflows/reusable_publish_docs.yml +++ b/.github/workflows/reusable_publish_docs.yml @@ -57,7 +57,7 @@ jobs: node-version: "20" cache: "npm" - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 - name: Set up Python uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 with: diff --git a/.github/workflows/run-e2e-tests.yml b/.github/workflows/run-e2e-tests.yml index 76bee15be5..6a626f975d 100644 --- a/.github/workflows/run-e2e-tests.yml +++ b/.github/workflows/run-e2e-tests.yml @@ -59,7 +59,7 @@ jobs: with: node-version: '20' - name: Setup dependencies - uses: ./.github/actions/cached-node-modules + uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 with: nodeVersion: '20' - name: Setup AWS credentials