-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.43 KB
/
python.yml
File metadata and controls
51 lines (51 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Python
on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch:
env:
PYTHON_VERSION: '3.14.3'
POETRY_VERSION: '2.3.2'
LINT_PATHS: >
app
tests
DATABASE_USER: postgres
DATABASE_PASSWORD: 123456
DATABASE_HOST: localhost
DATABASE_PORT: 5498
DATABASE_NAME: postgres
jobs:
build:
runs-on: ubuntu-latest
services:
postgresql:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123456
POSTGRES_DB: postgres
ports:
- 5498:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Install Dependencies
run: poetry install --no-interaction --no-root --without dev
if: steps.cache_dependencies.outputs.cache-hit != 'true'
- name: Flake8
run: poetry run flake8 ${{ env.LINT_PATHS }}
- name: Pylint
run: poetry run pylint ${{ env.LINT_PATHS }}
- name: Alembic
run: poetry run alembic upgrade head
- name: Pytest
run: poetry run pytest -n auto -m "not docker"