mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
wip: refactor ci
This commit is contained in:
parent
2404c12542
commit
21de7e2dfc
28
.github/workflows/build-and-test.yml
vendored
28
.github/workflows/build-and-test.yml
vendored
@ -7,20 +7,19 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [ "3.13" ]
|
python-version: [ "3.13" ]
|
||||||
poetry-version: [ "1.8.5" ]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHONDONTWRITEBYTECODE: 1
|
PYTHONDONTWRITEBYTECODE: 1
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
POSTGRES_DB: testdb
|
POSTGRES_DB: testdb
|
||||||
POSTGRES_HOST: 127.0.0.1
|
POSTGRES_HOST: 127.0.0.1
|
||||||
POSTGRES_USER: app-user
|
POSTGRES_USER: panettone
|
||||||
POSTGRES_PASSWORD: secret
|
POSTGRES_PASSWORD: secret
|
||||||
PGPASSWORD: secret
|
PGPASSWORD: secret
|
||||||
REDIS_HOST: 127.0.0.1
|
REDIS_HOST: 127.0.0.1
|
||||||
@ -37,7 +36,7 @@ jobs:
|
|||||||
sqldb:
|
sqldb:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: app-user
|
POSTGRES_USER: panettone
|
||||||
POSTGRES_PASSWORD: secret
|
POSTGRES_PASSWORD: secret
|
||||||
POSTGRES_DB: testdb
|
POSTGRES_DB: testdb
|
||||||
ports:
|
ports:
|
||||||
@ -48,18 +47,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Create database schema
|
- name: Create database schema
|
||||||
run: PGPASSWORD=secret psql -h 127.0.0.1 -d testdb -U app-user -c "CREATE SCHEMA shakespeare; CREATE SCHEMA happy_hog;"
|
run: PGPASSWORD=secret psql -h 127.0.0.1 -d testdb -U panettone -c "CREATE SCHEMA shakespeare; CREATE SCHEMA happy_hog;"
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
|
- name: Install the latest version of uv and set the python version
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install Poetry
|
|
||||||
uses: abatilo/actions-poetry@v3
|
- name: Test with python ${{ matrix.python-version }}
|
||||||
with:
|
run: uv run --frozen pytest
|
||||||
poetry-version: ${{ matrix.poetry-version }}
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
||||||
run: poetry install --no-interaction --no-root
|
|
||||||
- name: Test Code
|
|
||||||
run: poetry run pytest tests/
|
|
||||||
- name: Lint Code
|
|
||||||
run: poetry run ruff check .
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user