-
Notifications
You must be signed in to change notification settings - Fork 153
72 lines (72 loc) · 2.49 KB
/
run-e2e-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: run-e2e-tests
on:
workflow_dispatch: {}
jobs:
example-and-package-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Use NodeJS 16"
uses: actions/setup-node@v3
with:
node-version: 16
- name: "Install [email protected]"
run: npm i -g npm@next-8
- name: "Install monorepo packages"
# This installs all the dependencies of ./packages/*
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
run: npm ci --foreground-scripts
- name: Install CDK example packages
# Since we are not managing the CDK examples with npm workspaces we install
# the dependencies in a separate step
working-directory: ./examples/cdk
run: npm ci
- name: "Setup SAM"
# We use an ad-hoc action so we can specify the SAM CLI version
uses: aws-actions/setup-sam@v2
with:
version: 1.49.0
- name: Install SAM example packages
# Since we are not managing the SAM examples with npm workspaces we install
# the dependencies in a separate step
working-directory: ./examples/sam
run: npm ci
- name: "Test packaging"
run: |
npm run lerna-package
cd examples/cdk
npm install ../../packages/**/dist/aws-lambda-powertools-*
npm run test
e2e-tests:
runs-on: ubuntu-latest
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
strategy:
matrix:
package: [logger, metrics, tracer]
version: [12, 14, 16]
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Use NodeJS 16"
uses: actions/setup-node@v3
with:
node-version: 16
- name: "Install [email protected]"
run: npm i -g npm@next-8
- name: "Install monorepo packages"
# This installs all the dependencies of ./packages/*
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
run: npm ci --foreground-scripts
- name: "Configure AWS credentials"
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: eu-west-1
- name: "Run integration tests"
run: |
RUNTIME=nodejs${{ matrix.version }}x npm run test:e2e -w packages/${{ matrix.package }}