From 999ca04f6eb78b6d58bf891dc69b9f3779035a31 Mon Sep 17 00:00:00 2001 From: Egor Deev Date: Fri, 2 Oct 2026 13:31:03 +0000 Subject: [PATCH] =?UTF-8?q?CI:=20ruff=20=D0=B8=20=D1=82=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D1=8B=20=D0=BD=D0=B0=20PostgreSQL=20=D0=BD=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=B6=D0=B4=D1=8B=D0=B9=20push;=20Docker-=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=20=D0=BF=D0=BE=20=D1=82=D0=B5=D0=B3=D1=83=20?= =?UTF-8?q?=D0=B2=20GHCR=20=D0=B8=20dcr.deev.su?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++++ .github/workflows/docker.yml | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2398f8d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_USER: tablo + POSTGRES_PASSWORD: tablo + POSTGRES_DB: tablo_test + ports: ["5432:5432"] + options: >- + --health-cmd "pg_isready -U tablo" --health-interval 5s --health-retries 10 + env: + TEST_DATABASE_URL: postgresql://tablo:tablo@localhost:5432/tablo_test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements-dev.txt + - run: pip install -r requirements-dev.txt + - name: Ruff + run: ruff check . + - name: Тесты + run: pytest -q diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..78d3f0f --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,42 @@ +name: Docker + +on: + push: + tags: ["v*"] + workflow_dispatch: + +jobs: + image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/login-action@v3 + with: + registry: dcr.deev.su + username: ${{ secrets.ZOT_USERNAME }} + password: ${{ secrets.ZOT_PASSWORD }} + - id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/edeev/tablo + dcr.deev.su/edeev/tablo + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest + - uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}