Add Tests and Coverage Reporting #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
jobs: | |
unit_tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install python packages | |
run: pip install -Ur requirements.txt | |
- name: Set up ruby 3.2.2 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2.2' | |
- name: Install Ruby gems | |
run: gem install cfn-nag | |
- name: CloudFormation lint test | |
run: make cfn-lint | |
- name: CloudFormation nag test | |
run: make cfn-nag | |
- name: Run pytest | |
run: make test-unit |