Skip to content

Github Actions Unit tests #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/test:lambda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Lambda Unit Tests

on:
pull_request:
branches:
- main

jobs:
lambda-unit-tests:
runs-on: ubuntu-latest
name: Unit Tests
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 scripts/requirements.txt
pip install -r scripts/tests/test-requirements.txt
- name: Run Unit Tests
run: |
export AWS_DEFAULT_REGION=us-east-1
pytest scripts/tests \
--junitxml=test-results/junit.xml \
--cov=scripts/tests \
--cov-report=xml:test-results/coverage.xml
- name: Upload pytest results
uses: actions/upload-artifact@v4
with:
name: results
path: test-results
retention-days: 1
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
*.tfstate.*
*.tfstate
**.terraform*
**tfplan**
**tfplan**
.coverage
test-results/
4 changes: 1 addition & 3 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
boto3~=1.34.143
botocore~=1.34.143
pytest~=8.2.2
pytest-mock
botocore~=1.34.143
3 changes: 3 additions & 0 deletions scripts/tests/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest~=8.2.2
pytest-mock
pytest-cov