-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.32 KB
/
aws-lambda.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
74
75
76
77
78
79
80
81
# This starts up a simulator that tries to do what our Lambda@Edge does.
name: AWS Lambda@Edge
on:
pull_request:
branches:
- main
paths:
- deployer/aws-lambda/**
- libs/**
- .github/workflows/aws-lambda.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16"
cache: yarn
cache-dependency-path: |
deployer/aws-lambda/content-origin-request/yarn.lock
deployer/aws-lambda/content-origin-response/yarn.lock
deployer/aws-lambda/tests/yarn.lock
libs/**/*.js
# Note!
# We need to install all node modules in each of the 3 directories.
# 1. content-origin-request
# 2. content-origin-response
# 3. tests
#
# If we don't do this, you can't do things like:
#
# const { handler } = require("../content-origin-request");
#
# The reason `yarn install` won't pick up the sub-dependencies
# is because these 3 directories don't share a common root.
- name: Install all yarn packages
working-directory: deployer/aws-lambda/content-origin-request
run: yarn --frozen-lockfile
- name: Install all yarn packages
working-directory: deployer/aws-lambda/content-origin-response
run: yarn --frozen-lockfile
- name: Install all yarn packages
working-directory: deployer/aws-lambda/tests
run: yarn --frozen-lockfile
- name: Run test server
working-directory: deployer/aws-lambda/tests
run: |
yarn serve > /tmp/stdout.log 2> /tmp/stderr.log &
- name: Check that the server started
run: curl --retry-connrefused --retry 5 -I http://localhost:7000/ping
- name: Preflight the integration tests
run: |
curl -I http://localhost:7000/docs/Web
curl -I http://localhost:7000/en-US/docs/Web/
- name: End-to-end test
working-directory: deployer/aws-lambda/tests
run: |
yarn test-server
- name: Debug any server outputs
if: failure()
run: |
echo "____STDOUT____"
cat /tmp/stdout.log
echo "____STDERR____"
cat /tmp/stderr.log