Skip to content

Merge pull request #6 from CSC-510-G55/fix/deployment #11

Merge pull request #6 from CSC-510-G55/fix/deployment

Merge pull request #6 from CSC-510-G55/fix/deployment #11

Workflow file for this run

name: Code Coverage
on: [push]
jobs:
upload-coverage:
runs-on: ubuntu-latest
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9 # Replace '3.x' with your desired Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Create env file
run: |
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" > .env
echo "MONGO_URI=${{ secrets.MONGO_URI }}" >> .env
- name: Generate coverage
run: |
pytest -v --cov-config=.coveragerc --cov --cov-report=xml
python -c "import os;from pymongo import MongoClient; client = MongoClient(os.getenv('MONGO_URI')); client.testDB.movies.drop(); client.close()"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}