Skip to content

modified .yml to get it working again #38

modified .yml to get it working again

modified .yml to get it working again #38

Workflow file for this run

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
pip install codeclimate-test-reporter # Install CodeClimate Test Reporter
- name: Set up environment
run: |
source venv/bin/activate # Ensure the virtual environment is active
source ./add_root_to_path.sh # Run the script to modify PYTHONPATH
- name: Run tests with coverage
run: |
source venv/bin/activate # Ensure the virtual environment is active
pytest --cov=. --cov-report=xml:coverage.xml # Generate coverage report in the current directory
- name: List files in the directory after tests
run: ls -la
- name: Check if coverage.xml exists
run: |
if [ ! -f coverage.xml ]; then
echo "coverage.xml not found!"
exit 1
fi
- name: Upload coverage to CodeClimate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} # Use the secret for CodeClimate
run: |
source venv/bin/activate # Ensure the virtual environment is active
codeclimate-test-reporter < coverage.xml # Upload the coverage report to CodeClimate