diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..e3b21e6 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,36 @@ +--- +name: Codecov +on: + push: + pull_request: + workflow_dispatch: +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + python-version: + - "3.11" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r app/requirements.txt + pip install pytest-cov + - name: Run tests and collect coverage + run: | + pytest --cov=app --cov-report=xml tests/ + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.4.1 + with: + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/app/app.py b/app/app.py index 21cb04a..06b34da 100644 --- a/app/app.py +++ b/app/app.py @@ -9,8 +9,7 @@ from flask_paginate import Pagination from werkzeug.utils import secure_filename from flask_session import Session -# pylint: disable-next=import-error -from upd import get_latest_version, update_needed +from .upd import get_latest_version, update_needed app = Flask(__name__) app.secret_key = "secret_key"