From 1aab121cb6986f9ab95d3bc9de1b285fbb90eb0b Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Tue, 9 Jun 2026 16:47:17 +0300 Subject: [PATCH] ci: align with modern-di MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Standardize action pins on @v6/@v4/@v8.2.0 (previously had a stale actions/checkout@v3 in the pytest job alongside @v4 in lint — internal inconsistency). - Drop codecov upload step. Coverage floor enforced locally. - Split ci.yml into thin trigger wrapper + reusable _checks.yml. The pytest job preserves its existing raw `uv sync` + `uv run pytest` pattern (does not use `just`) and its postgres services block. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/_checks.yml | 44 ++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 51 ++--------------------------------- .github/workflows/publish.yml | 6 ++--- 3 files changed, 49 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/_checks.yml diff --git a/.github/workflows/_checks.yml b/.github/workflows/_checks.yml new file mode 100644 index 0000000..b0b9939 --- /dev/null +++ b/.github/workflows/_checks.yml @@ -0,0 +1,44 @@ +name: checks +on: + workflow_call: {} + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v4 + - uses: astral-sh/setup-uv@v8.2.0 + with: + enable-cache: true + cache-dependency-glob: "**/pyproject.toml" + - run: uv python install 3.13 + - run: just install lint-ci + + pytest: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:latest + env: + POSTGRES_DB: postgres + POSTGRES_PASSWORD: password + POSTGRES_USER: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v6 + - uses: astral-sh/setup-uv@v8.2.0 + - run: uv python install 3.13 + - run: | + uv sync --all-extras --no-install-project + uv run --no-sync pytest . --cov=. --cov-report xml + env: + PYTHONDONTWRITEBYTECODE: 1 + PYTHONUNBUFFERED: 1 + DB_DSN: postgresql+asyncpg://postgres:password@127.0.0.1/postgres diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c71a1ca..85af5ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,4 @@ name: main - on: push: branches: @@ -11,51 +10,5 @@ concurrency: cancel-in-progress: true jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: extractions/setup-just@v2 - - uses: astral-sh/setup-uv@v3 - with: - enable-cache: true - cache-dependency-glob: "**/pyproject.toml" - - run: uv python install 3.13 - - run: just install lint-ci - - pytest: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:latest - env: - POSTGRES_DB: postgres - POSTGRES_PASSWORD: password - POSTGRES_USER: postgres - ports: - - 5432:5432 - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v3 - - uses: astral-sh/setup-uv@v3 - - run: uv python install 3.13 - - run: | - uv sync --all-extras --no-install-project - uv run --no-sync pytest . --cov=. --cov-report xml - env: - PYTHONDONTWRITEBYTECODE: 1 - PYTHONUNBUFFERED: 1 - DB_DSN: postgresql+asyncpg://postgres:password@127.0.0.1/postgres - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.0.1 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: ./coverage.xml - flags: unittests - name: codecov-${{ matrix.python-version }} + checks: + uses: ./.github/workflows/_checks.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b637272..916fc36 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,9 +9,9 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: extractions/setup-just@v2 - - uses: astral-sh/setup-uv@v3 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v4 + - uses: astral-sh/setup-uv@v8.2.0 - run: just publish env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}