modified .yml to get correct coverage version #42
Workflow file for this run
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
on: [push, pull_request] | |
jobs: | |
run-unittests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
- name: Create and activate virtual environment | |
run: | | |
python -m venv venv # Create a virtual environment | |
source venv/bin/activate # Activate the virtual environment | |
- name: Install dependencies | |
run: | | |
source venv/bin/activate # Ensure the virtual environment is active | |
pip install --upgrade pip # Upgrade pip within the virtual environment | |
pip install -r requirements.txt # Install dependencies from requirements.txt | |
- name: Run tests with coverage | |
run: | | |
source venv/bin/activate # Ensure the virtual environment is active | |
pytest --cov=. --cov-report=xml # Generate coverage report in XML format | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml # Path to your coverage report | |
token: ${{ secrets.CODECOV_TOKEN }} # Set this in your repository secrets |