This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
Feature Pull Request: Create a Basic Api with Fastapi #126
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: Run Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root | |
- name: Run MyPy | |
run: | | |
poetry run mypy SmartManager | |
- name: Run Flake8 | |
run: | | |
poetry run flake8 SmartManager | |
- name: Run Pytest | |
run: | | |
poetry run coverage run -m pytest | |
- name: Coverage Report | |
run: | | |
poetry run coverage report | |
report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root | |
- name: Run Pytest | |
run: | | |
poetry run coverage run -m pytest | |
- name: Generate HTML Coverage Report | |
run: | | |
poetry run coverage html -d coverage_html | |
- name: Upload HTML Report as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage_html |