Skip to content

Config code coverage #4

Config code coverage

Config code coverage #4

Workflow file for this run

name: Python FastAPI CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Check out the code from the repository
- name: Check out code
uses: actions/checkout@v3
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.7' # Or whichever version your project requires
# Install dependencies
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# Run tests
- name: Run tests with coverage
run: |
source venv/bin/activate
PYTHONPATH=./ pytest --cov=app .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}