Skip to content

Commit bb0d795

Browse files
first commit
0 parents  commit bb0d795

File tree

136 files changed

+14979
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+14979
-0
lines changed

.github/Playwright-serverless.png

67 KB
Loading
9.7 KB
Loading

.github/duration-lambda.png

15.2 KB
Loading

.github/invocations-lambda.png

7.56 KB
Loading
7.56 MB
Loading

.github/workflows/deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy Lambda
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
deploy-prod:
10+
11+
runs-on: ubuntu-18.04
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Node.js Setup
16+
uses: actions/setup-node@v1
17+
- name: Install NPM dependencies
18+
run: npm install
19+
- name: Install Serverless Framework
20+
run: npm install -g [email protected]
21+
- name: Serverless AWS authentication
22+
run: serverless config credentials --provider AWS --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
- name: Deploy Lambda functions
24+
run: make deploy

.github/workflows/test-serverless.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run test on Lambda
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
9+
runs-on: ubuntu-18.04
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Node.js Setup
14+
uses: actions/setup-node@v1
15+
- name: Install NPM dependencies
16+
run: |
17+
cd serverless-runner
18+
npm install
19+
- name: Install Serverless Framework
20+
run: npm install -g [email protected]
21+
- name: Serverless AWS authentication
22+
run: serverless config credentials --provider AWS --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
- name: Run test on serverless
24+
run: make test-serverless

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.serverless/
2+
node_modules/
3+
reports/

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Define custom function directory
2+
ARG FUNCTION_DIR="/function"
3+
4+
FROM node:14-alpine3.12 as build-image
5+
6+
# Include global arg in this stage of the build
7+
ARG FUNCTION_DIR
8+
9+
RUN apk add --update-cache \
10+
build-base \
11+
libtool \
12+
libressl-dev \
13+
musl-dev \
14+
libffi-dev \
15+
autoconf \
16+
automake \
17+
libexecinfo-dev \
18+
make \
19+
cmake \
20+
python3 \
21+
py3-pip \
22+
libcurl
23+
24+
# Create function directory
25+
RUN mkdir -p ${FUNCTION_DIR}
26+
27+
WORKDIR ${FUNCTION_DIR}
28+
29+
# Copy test files and handler
30+
COPY lambda/handler.js ${FUNCTION_DIR}
31+
COPY tests/ ${FUNCTION_DIR}
32+
33+
# Install the function's dependencies
34+
RUN npm ci
35+
36+
FROM node:14-alpine3.12
37+
38+
# Installs latest Chromium package.
39+
RUN apk add --no-cache \
40+
chromium \
41+
nss \
42+
freetype \
43+
freetype-dev \
44+
harfbuzz \
45+
ca-certificates \
46+
ttf-freefont
47+
48+
# Include global arg in this stage of the build
49+
ARG FUNCTION_DIR
50+
51+
# Set working directory to function root directory
52+
WORKDIR ${FUNCTION_DIR}
53+
54+
# Copy in the built dependencies
55+
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}
56+
57+
ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
58+
CMD ["handler.runTest"]

0 commit comments

Comments
 (0)