@@ -2,48 +2,63 @@ name: run-e2e-tests
22on :
33 workflow_dispatch : {}
44jobs :
5- run :
6- # ########################
7- # Force Github action to run only a single job at a time (based on the group name)
8- # This is to prevent "race-condition" in building e2e tests infrastructure
9- # ########################
10- concurrency :
11- group : e2e-tests
5+ example-and-package-check :
6+ runs-on : ubuntu-latest
7+ permissions :
8+ contents : read
9+ steps :
10+ - name : " Checkout"
11+ uses : actions/checkout@v3
12+ - name : " Use NodeJS 14"
13+ uses : actions/setup-node@v3
14+ with :
15+ # Always use version 14 as we use TypeScript target es2020
16+ node-version : 14
17+ -
name :
" Install [email protected] " 18+ run : npm i -g npm@next-8
19+ - name : " Install monorepo packages"
20+ # This installs all the dependencies of ./packages/*
21+ # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
22+ run : npm ci --foreground-scripts
23+ - name : " Install example packages"
24+ # Since we are not managing the cdk examples with npm workspaces we install
25+ # the dependencies in a separate step
26+ working-directory : ./examples/cdk
27+ run : npm ci
28+ - name : " Test packaging"
29+ run : |
30+ npm run lerna-package
31+ cd examples/cdk
32+ npm install ../../packages/**/dist/aws-lambda-powertools-*
33+ npm run test
34+ e2e-tests :
1235 runs-on : ubuntu-latest
1336 permissions :
1437 id-token : write # needed to interact with GitHub's OIDC Token endpoint.
1538 contents : read
39+ strategy :
40+ matrix :
41+ version : [12, 14]
42+ package : [logger, metrics, tracing]
1643 steps :
17- - name : " Checkout"
18- uses : actions/checkout@v3
19- # ########################
20- # Release new version
21- # ########################
22- - name : " Use NodeJS 14"
23- uses : actions/setup-node@v3
24- with :
25- node-version : ' 14'
26- 27- run : npm i -g npm@next-8
28- - name : Install monorepo packages
29- # This installs all the dependencies of ./packages/*
30- # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
31- run : npm ci --foreground-scripts
32- - name : Install example packages
33- # Since we are not managing the cdk examples with npm workspaces we install
34- # the dependencies in a separate step
35- working-directory : ./examples/cdk
36- run : npm ci
37- - name : Configure AWS credentials
38- uses :
aws-actions/[email protected] 39- with :
40- role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
41- aws-region : eu-west-1
42- - name : Run integration tests
43- run : npm run lerna-test:e2e
44- - name : Test packaging
45- run : |
46- npm run lerna-package
47- cd examples/cdk
48- npm install ../../packages/**/dist/aws-lambda-powertools-*
49- npm run test
44+ - name : " Checkout"
45+ uses : actions/checkout@v3
46+ - name : " Use NodeJS 14"
47+ uses : actions/setup-node@v3
48+ with :
49+ # Always use version 14 as we use TypeScript target es2020
50+ node-version : 14
51+ -
name :
" Install [email protected] " 52+ run : npm i -g npm@next-8
53+ - name : " Install monorepo packages"
54+ # This installs all the dependencies of ./packages/*
55+ # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
56+ run : npm ci --foreground-scripts
57+ - name : " Configure AWS credentials"
58+ uses :
aws-actions/[email protected] 59+ with :
60+ role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
61+ aws-region : eu-west-1
62+ - name : " Run integration tests"
63+ run : |
64+ RUNTIME=nodejs${{ matrix.version }}x npm run test:e2e -w packages/${{ matrix.package }}
0 commit comments