-
-
Notifications
You must be signed in to change notification settings - Fork 72
73 lines (59 loc) · 1.73 KB
/
aws.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
73
name: AWS Lambda CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: Build Lambda Layer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Packages
run: npm ci
- name: Compile Typescript
run: npm run build
- name: Create Lambda Layer
run: make chromium.zip
- name: Upload Layer Artifact
uses: actions/upload-artifact@v4
with:
name: chromium
path: chromium.zip
execute:
name: Lambda (Node ${{ matrix.version }}.x)
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
event:
- example.com
version:
- 16
- 18
- 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Setup AWS SAM CLI
uses: aws-actions/setup-sam@v2
- name: Download Layer Artifact
uses: actions/download-artifact@v4
with:
name: chromium
- name: Provision Layer
run: unzip chromium.zip -d _/amazon/code
- name: Install test dependencies
run: npm install --prefix _/amazon/handlers puppeteer-core --bin-links=false --fund=false --omit=optional --omit=dev --package-lock=false --save=false
- name: Invoke Lambda on SAM
run: sam local invoke --template _/amazon/template.yml --event _/amazon/events/${{ matrix.event }}.json node${{ matrix.version }} 2>&1 | (grep 'Error' && exit 1 || exit 0)