-
Notifications
You must be signed in to change notification settings - Fork 12
37 lines (36 loc) · 1.31 KB
/
sample-app-docker-build.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
name: Validate Nuget Package Docker Build
on: [pull_request]
jobs:
lambda-docker-build-dotnet:
strategy:
fail-fast: false
matrix:
version: [6, 7, 8]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.version }}.x
- run: dotnet tool install -g Amazon.Lambda.Tools
- name: Build and package nuget
uses: cake-build/cake-action@v1
with:
cake-version: 1.3.0
- name: Build and package lambda
working-directory: ./sample/SampleLambda-dotnet${{ matrix.version }}
run: dotnet lambda package SampleLambda --profile default --region us-west-1
- name: Run docker
run: docker run --detach -p 9000:8080 samplelambda-dotnet${{ matrix.version }}:latest
- name: Test function
run: |
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' -o /tmp/lambda_result.txt
if $(grep -q iVB /tmp/lambda_result.txt); then
echo "SUCCESS: The lambda rendered a PNG"
exit 0
else
echo "FAILURE: The lambda did not return expected png value starting with iVB"
cat /tmp/lambda_result.txt
exit 1
fi
shell: bash