Skip to content

Update python Docker tag to v3.12.7 #25

Update python Docker tag to v3.12.7

Update python Docker tag to v3.12.7 #25

Workflow file for this run

name: Check master branch commit
on:
push:
branches: [ "master" ]
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12.1"
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
tests:
needs: setup
runs-on: ubuntu-latest
env:
TZ: "Europe/Moscow"
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: almazilaletdinov
POSTGRES_DB: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12.1"
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: create .env file
run: cp .github/.env .env
- name: Run tests with pytest
run: |
. .venv/bin/activate
cd src
pytest --doctest-modules --cov --cov-report xml # --cov-fail-under=95
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: src/coverage.xml
fail_ci_if_error: true
lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12.1"
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Lint via ruff
run: .venv/bin/ruff check src
# - name: Lint via flake8
# run: .venv/bin/flake8 src
- name: Lint via refurb
run: .venv/bin/refurb src
# - name: Check types with mypy
# run: .venv/bin/mypy src