Handled exceptions in python files #393
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: Python application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
# cache: "pip" | |
# - run: pip install -r requirements.txt | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install uv | |
uv pip install flake8 pytest pytest-cov | |
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi | |
- name: Test with pytest | |
run: | | |
source venv/bin/activate | |
pytest --cov --cov-report term --cov-report xml:coverage.xml || true | |
continue-on-error: true | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: devansh-shah-11/FaceRec | |
files: coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
# fail_ci_if_error: true |