fix: report SDK user error for invalid span name #1047
Workflow file for this run
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
# PR's only | |
name: "Node: Validate" | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- node/** | |
- proto/** | |
env: | |
FORCE_COLOR: 1 | |
FORMAT_INSPECT_DEPTH: 20 | |
jobs: | |
linuxNode16: | |
name: "[Linux] Node.js v16: Lint, Formatting, Eventual Commitlint, Eventual Changelog & Unit Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
# For commitlint purpose ensure to have complete list of PR commits | |
# It's loose and imperfect assumption that PR has no more than 30 commits | |
fetch-depth: 30 | |
- name: Retrieve last main commit (for `git diff` purposes) | |
run: | | |
git checkout -b pr | |
git fetch --prune --depth=30 origin +refs/heads/main:refs/remotes/origin/main | |
git checkout main | |
git checkout pr | |
- name: Resolve path filters | |
uses: dorny/paths-filter@v2 | |
id: pathChanges | |
with: | |
filters: | | |
awsLambdaOtelExtension: | |
- 'node/packages/aws-lambda-otel-extension/**' | |
awsLambdaSdk: | |
- 'node/packages/aws-lambda-sdk/**' | |
sdk: | |
- 'node/packages/sdk/**' | |
sdkSchema: | |
- 'node/packages/sdk-schema/**' | |
proto: | |
- 'proto/**' | |
- name: Retrieve ~/.npm from cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/**package*.json') }} | |
restore-keys: | | |
npm-v16-${{ runner.os }}-${{ github.ref }}- | |
npm-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve node_modules from cache | |
id: cacheNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/node_modules | |
key: node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/package.json') }} | |
restore-keys: | | |
node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/node_modules | |
key: packages/aws-lambda-otel-extension/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/external/otel-extension-external/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionExternalOtelExtensionExternalNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/external/otel-extension-external/node_modules | |
key: packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/external/otel-extension-external/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionInternalOtelExtensionInternalNodeNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node_modules | |
key: packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/test/fixtures/lambdas from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionTestFixturesLambdasNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/test/fixtures/lambdas/node_modules | |
key: packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/test/fixtures/lambdas/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-sdk/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
id: cacheAwsLambdaSdkNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-sdk/node_modules | |
key: packages/aws-lambda-sdk/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-sdk/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-sdk/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-sdk/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-sdk/test/fixtures/lambdas from cache | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
id: cacheAwsLambdaSdkTestFixturesLambdasNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-sdk/test/fixtures/lambdas/node_modules | |
key: packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-sdk/test/fixtures/lambdas/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/sdk/node_modules from cache | |
if: steps.pathChanges.outputs.sdk == 'true' | |
id: cacheSdkNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/sdk/node_modules | |
key: packages/sdk/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/sdk/package.json') }} | |
restore-keys: | | |
packages/sdk/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/sdk/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/sdk-schema/node_modules from cache | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
id: cacheSdkSchemaNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/sdk-schema/node_modules | |
key: packages/sdk-schema/node-modules-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/sdk-schema/package.json') }} | |
restore-keys: | | |
packages/sdk-schema/node-modules-v16-${{ runner.os }}-${{ github.ref }}- | |
packages/sdk-schema/node-modules-v16-${{ runner.os }}-refs/heads/main- | |
- name: Install Node.js and npm | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Install main project dependencies | |
if: steps.cacheNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node | |
npm update --save-dev --no-save | |
- name: Install packages/aws-lambda-otel-extension dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/external/otel-extension-external dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionExternalOtelExtensionExternalNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/external/otel-extension-external | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/internal/otel-extension-internal-node dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionInternalOtelExtensionInternalNodeNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/test/fixtures/lambdas dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionTestFixturesLambdasNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/test/fixtures/lambdas | |
npm update --no-save | |
- name: Install packages/aws-lambda-sdk dependencies | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' && steps.cacheAwsLambdaSdkNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk | |
npm update --no-save | |
- name: Install packages/aws-lambda-sdk/test/fixtures/lambdas dependencies | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' && steps.cacheAwsLambdaSdkTestFixturesLambdasNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk/test/fixtures/lambdas | |
npm update --no-save | |
- name: Install packages/sdk dependencies | |
if: steps.pathChanges.outputs.sdk == 'true' && steps.cacheSdkNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/sdk | |
npm update --no-save | |
- name: Install packages/sdk-schema dependencies | |
if: (steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true') && steps.cacheSdkSchemaNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/sdk-schema | |
npm update --no-save | |
- name: Validate Prettier formatting | |
run: | | |
cd node | |
npm run prettier-check:updated | |
- name: Validate ESLint rules | |
run: | | |
cd node | |
npm run lint:updated | |
- name: Validate packages/aws-lambda-otel-extension commit messages | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id | |
run: | | |
cd node | |
./scripts/commitlint.js packages/aws-lambda-otel-extension main..HEAD | |
- name: Validate packages/aws-lambda-sdk commit messages | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id | |
run: | | |
cd node | |
./scripts/commitlint.js packages/aws-lambda-sdk main..HEAD | |
- name: Validate packages/sdk commit messages | |
if: steps.pathChanges.outputs.sdk == 'true' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id | |
run: | | |
cd node | |
./scripts/commitlint.js packages/sdk main..HEAD | |
- name: Validate packages/sdk-schema commit messages | |
if: steps.pathChanges.outputs.sdkSchema == 'true' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id | |
run: | | |
cd node | |
./scripts/commitlint.js packages/sdk-schema main..HEAD | |
- name: Validate packages/aws-lambda-otel-extension changelog (if new version) | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension | |
NEW_VERSION=`git diff -U0 main package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : | |
if [ -n "$NEW_VERSION" ] && [ $NEW_VERSION != "0.0.0"]; | |
then | |
npx dump-release-notes-from-cc-changelog $NEW_VERSION | |
fi | |
- name: Validate packages/aws-lambda-sdk changelog (if new version) | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk | |
NEW_VERSION=`git diff -U0 main package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : | |
if [ -n "$NEW_VERSION" ] && [ $NEW_VERSION != "0.0.0"]; | |
then | |
npx dump-release-notes-from-cc-changelog $NEW_VERSION | |
fi | |
- name: Validate packages/sdk changelog (if new version) | |
if: steps.pathChanges.outputs.sdk == 'true' | |
run: | | |
cd node/packages/sdk | |
NEW_VERSION=`git diff -U0 main package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : | |
if [ -n "$NEW_VERSION" ] && [ $NEW_VERSION != "0.0.0"]; | |
then | |
npx dump-release-notes-from-cc-changelog $NEW_VERSION | |
fi | |
- name: Validate packages/sdk-schema changelog (if new version) | |
if: steps.pathChanges.outputs.sdkSchema == 'true' | |
run: | | |
cd node/packages/sdk-schema | |
NEW_VERSION=`git diff -U0 main package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : | |
if [ -n "$NEW_VERSION" ] && [ $NEW_VERSION != "0.0.0"]; | |
then | |
npx dump-release-notes-from-cc-changelog $NEW_VERSION | |
fi | |
- name: Unit tests aws-lambda-otel-extension | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension | |
npm test | |
- name: Unit tests aws-lambda-sdk | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk | |
npm test | |
- name: Unit tests sdk | |
if: steps.pathChanges.outputs.sdk == 'true' | |
run: | | |
cd node/packages/sdk | |
npm test | |
- name: Buf Setup | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
uses: bufbuild/buf-setup-action@v1 | |
with: | |
github_token: ${{ github.token }} | |
- name: Buf Lint | |
if: steps.pathChanges.outputs.proto == 'true' | |
uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: "proto" | |
github_token: ${{ github.token }} | |
- name: Build /sdk-schema | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
run: | | |
cd proto | |
buf build | |
buf generate | |
cd ../node/packages/sdk-schema | |
npm run build | |
- name: Unit tests /sdk-schema | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
run: | | |
cd node/packages/sdk-schema | |
npm test | |
linuxNode14: | |
name: "[Linux] Node.js v14: Isolated unit Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Resolve path filters | |
uses: dorny/paths-filter@v2 | |
id: pathChanges | |
with: | |
filters: | | |
awsLambdaOtelExtension: | |
- 'node/packages/aws-lambda-otel-extension/**' | |
awsLambdaSdk: | |
- 'node/packages/aws-lambda-sdk/**' | |
sdk: | |
- 'node/packages/sdk/**' | |
sdkSchema: | |
- 'node/packages/sdk-schema/**' | |
proto: | |
- 'proto/**' | |
- name: Retrieve ~/.npm from cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/**package*.json') }} | |
restore-keys: | | |
npm-v14-${{ runner.os }}-${{ github.ref }}- | |
npm-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve node_modules from cache | |
id: cacheNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/node_modules | |
key: node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/package.json') }} | |
restore-keys: | | |
node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/node_modules | |
key: packages/aws-lambda-otel-extension/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/external/otel-extension-external/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionExternalOtelExtensionExternalNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/external/otel-extension-external/node_modules | |
key: packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/external/otel-extension-external/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/external/otel-extension-external/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionInternalOtelExtensionInternalNodeNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node_modules | |
key: packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/internal/otel-extension-internal-node/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-otel-extension/test/fixtures/lambdas from cache | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
id: cacheAwsLambdaOtelExtensionTestFixturesLambdasNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-otel-extension/test/fixtures/lambdas/node_modules | |
key: packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-otel-extension/test/fixtures/lambdas/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-otel-extension/test/fixtures/lambdas/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-sdk/node_modules from cache | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
id: cacheAwsLambdaSdkNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-sdk/node_modules | |
key: packages/aws-lambda-sdk/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-sdk/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-sdk/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-sdk/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/aws-lambda-sdk/test/fixtures/lambdas from cache | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
id: cacheAwsLambdaSdkTestFixturesLambdasNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/aws-lambda-sdk/test/fixtures/lambdas/node_modules | |
key: packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/aws-lambda-sdk/test/fixtures/lambdas/package.json') }} | |
restore-keys: | | |
packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/aws-lambda-sdk/test/fixtures/lambdas/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/sdk/node_modules from cache | |
if: steps.pathChanges.outputs.sdk == 'true' | |
id: cacheSdkNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/sdk/node_modules | |
key: packages/sdk/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/sdk/package.json') }} | |
restore-keys: | | |
packages/sdk/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/sdk/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Retrieve packages/sdk-schema/node_modules from cache | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
id: cacheSdkSchemaNodeModules | |
uses: actions/cache@v2 | |
with: | |
path: node/packages/sdk-schema/node_modules | |
key: packages/sdk-schema/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('node/packages/sdk-schema/package.json') }} | |
restore-keys: | | |
packages/sdk-schema/node-modules-v14-${{ runner.os }}-${{ github.ref }}- | |
packages/sdk-schema/node-modules-v14-${{ runner.os }}-refs/heads/main- | |
- name: Install Node.js and npm | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Install main project dependencies | |
if: steps.cacheNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node | |
npm update --save-dev --no-save | |
- name: Install packages/aws-lambda-otel-extension dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/external/otel-extension-external dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionExternalOtelExtensionExternalNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/external/otel-extension-external | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/internal/otel-extension-internal-node dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionInternalOtelExtensionInternalNodeNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/internal/otel-extension-internal-node | |
npm update --no-save | |
- name: Install packages/aws-lambda-otel-extension/test/fixtures/lambdas dependencies | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' && steps.cacheAwsLambdaOtelExtensionTestFixturesLambdasNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-otel-extension/test/fixtures/lambdas | |
npm update --no-save | |
- name: Install packages/aws-lambda-sdk dependencies | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' && steps.cacheAwsLambdaSdkNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk | |
npm update --no-save | |
- name: Install packages/aws-lambda-sdk/test/fixtures/lambdas dependencies | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' && steps.cacheAwsLambdaSdkTestFixturesLambdasNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/aws-lambda-sdk/test/fixtures/lambdas | |
npm update --no-save | |
- name: Install packages/sdk dependencies | |
if: steps.pathChanges.outputs.sdk == 'true' && steps.cacheSdkNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/sdk | |
npm update --no-save | |
- name: Install packages/sdk-schema dependencies | |
if: (steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true') && steps.cacheSdkSchemaNodeModules.outputs.cache-hit != 'true' | |
run: | | |
cd node/packages/sdk-schema | |
npm update --no-save | |
- name: Unit tests aws-lambda-otel-extension | |
if: steps.pathChanges.outputs.awsLambdaOtelExtension == 'true' | |
run: | | |
# npm v6 doesn't add parent node_modules/.bin to PATH, workaround it | |
export PATH="$PWD/node/node_modules/.bin:$PATH" | |
cd node/packages/aws-lambda-otel-extension | |
npm run test:isolated | |
- name: Unit tests aws-lambda-sdk | |
if: steps.pathChanges.outputs.awsLambdaSdk == 'true' | |
run: | | |
# npm v6 doesn't add parent node_modules/.bin to PATH, workaround it | |
export PATH="$PWD/node/node_modules/.bin:$PATH" | |
cd node/packages/aws-lambda-sdk | |
npm run test:isolated | |
- name: Unit tests sdk | |
if: steps.pathChanges.outputs.sdk == 'true' | |
run: | | |
# npm v6 doesn't add parent node_modules/.bin to PATH, workaround it | |
export PATH="$PWD/node/node_modules/.bin:$PATH" | |
cd node/packages/sdk | |
npm run test:isolated | |
- name: Buf Setup | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
uses: bufbuild/buf-setup-action@v1 | |
with: | |
github_token: ${{ github.token }} | |
- name: Build /sdk-schema | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
run: | | |
# npm v6 doesn't add parent node_modules/.bin to PATH, workaround it | |
export PATH="$PWD/node/node_modules/.bin:$PATH" | |
cd proto | |
buf build | |
buf generate | |
cd ../node/packages/sdk-schema | |
npm run build | |
- name: Unit tests /sdk-schema | |
if: steps.pathChanges.outputs.sdkSchema == 'true' || steps.pathChanges.outputs.proto == 'true' | |
run: | | |
# npm v6 doesn't add parent node_modules/.bin to PATH, workaround it | |
export PATH="$PWD/node/node_modules/.bin:$PATH" | |
cd node/packages/sdk-schema | |
npm run test:isolated |