created unit tests for view_tasks() #38
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: Lint check, test, and generate code coverage report | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint-check-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install depedencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run ruff | |
run: | | |
ruff check src/ tests/ --config pyproject.toml | |
- name: Run pytest with coverage | |
run: pytest --cov-report=html # outputs coverage report to htmlcov | |
- name: Upload coverage report as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: htmlcov | |
deploy: | |
runs-on: ubuntu-latest | |
needs: lint-check-and-test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-report | |
path: ./coverage-html |