-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.22 KB
/
test:lambda.yaml
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
name: Python package
on:
push:
branches:
- unit-tests
# pull_request:
# branches:
# - main
jobs:
lambda-unit-tests:
runs-on: ubuntu-latest
name: Lambda Unit Tests
env:
LAMBDA_DIR: scripts
TEST_RESULTS_DIR: test-results
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r "$LAMBDA_DIR/requirements.txt"
pip install -r "$LAMBDA_DIR/tests/test-requirements.txt"
- name: Run Tests
run: |
export AWS_DEFAULT_REGION=us-east-1
pytest "$LAMBDA_DIR/tests" \
--junitxml="$TEST_RESULTS_DIR/junit.xml" \
--cov="$LAMBDA_DIR/tests" \
--cov-report=xml:"$TEST_RESULTS_DIR/coverage.xml"
- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: results
path: "$TEST_RESULTS_DIR/coverage.xml"
- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: results
path: "$TEST_RESULTS_DIR/junit.xml"