-
Notifications
You must be signed in to change notification settings - Fork 398
58 lines (48 loc) · 1.53 KB
/
Copy pathdockerized-test.yml
File metadata and controls
58 lines (48 loc) · 1.53 KB
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
name: dockerized-test
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
jobs:
dockerized-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Load environment variables
run: |
if [ -f .env ]; then
set -a
source .env
set +a
echo "HANDLERS_TO_BUILD=${HANDLERS_TO_BUILD}" >> $GITHUB_ENV
echo "OUTPUT_DIR=${OUTPUT_DIR}" >> $GITHUB_ENV
fi
- name: Build the image
run: |
docker build . -t local/test -f Dockerfile.rie \
--build-arg HANDLERS_TO_BUILD="${HANDLERS_TO_BUILD}" \
--build-arg OUTPUT_DIR="${OUTPUT_DIR}"
- name: Test container manually
run: |
docker run -d --name test-container -p 9000:8080 local/test basic-lambda
sleep 15
echo "Container logs after startup:"
docker logs test-container
echo "Attempting to invoke function:"
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"command":"test"}' || echo "Invocation failed"
echo "Final container logs:"
docker logs test-container
docker kill test-container || true
- name: Run tests
uses: aws/containerized-test-runner-for-aws-lambda@main
with:
suiteFileArray: '["./test/dockerized/*.json"]'
dockerImageName: 'local/test'