Skip to content

testing

testing #19

Workflow file for this run

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"