From e2012aa3d634572a7b41b2ce8a9be695e577d3fd Mon Sep 17 00:00:00 2001 From: Jayson Reis Date: Wed, 9 Sep 2026 00:56:40 +0200 Subject: [PATCH 1/3] ci: modernize the tests-and-lint workflow and add Renovate The workflow used three different major action versions across four call sites. It routed both jobs through two shell scripts. That pattern comes from Travis, which needed an environment variable to branch a build matrix. GitHub Actions has two native jobs already. Workflow changes: - actions/checkout@v7 and actions/setup-python@v7 at every call site. - A concurrency group that cancels an outdated run in progress. - A top-level "permissions: contents: read" block. - timeout-minutes on both jobs. - "cache: pip" on both setup-python steps. - fail-fast: false, so one failed version does not hide the other results. max-parallel: 4 is gone. The matrix holds five legs. - The steps run inline. The coverage run writes coverage.xml and uploads it as an artifact. .ci-before-script.sh and .ci-runs-tests.sh are deleted. Both cost more than they gave. "pip install -e ." ran twice. The "env" call printed the whole environment to a public log. The memcached install had no -y flag. .travis.yml is deleted. It calls .travis-before-script.sh and .travis-runs-tests.sh. Neither file exists in the repository. The Travis badge in docs/intro.rst now points at the GitHub Actions badge. renovate.json is new. Renovate groups patch, minor, and digest updates into one pull request. Dependabot cannot group by update type. Each major update gets its own pull request and waits for approval on the dependency dashboard. The pip_requirements manager is out of enabledManagers. Issue #270 deleted requirements_test.txt. Warning: the Renovate GitHub App must be installed on this repository. Config alone does nothing. Refs #271 --- .ci-before-script.sh | 16 ------- .ci-runs-tests.sh | 19 --------- .github/workflows/tests-and-lint.yml | 62 ++++++++++++++++++++-------- renovate.json | 31 +++++++++++++- 4 files changed, 75 insertions(+), 53 deletions(-) delete mode 100755 .ci-before-script.sh delete mode 100755 .ci-runs-tests.sh diff --git a/.ci-before-script.sh b/.ci-before-script.sh deleted file mode 100755 index 86ab9d5..0000000 --- a/.ci-before-script.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -ex - -python -m pip install --upgrade pip -pip install -e . && pip install --group test - -if [ "$STEP" = "lint" ]; then - pip install --group lint -fi - -if [ "$STEP" != "tests" ]; then - exit 0 -fi - -sudo apt-get update -sudo apt-get install -y memcached diff --git a/.ci-runs-tests.sh b/.ci-runs-tests.sh deleted file mode 100755 index 33f21e1..0000000 --- a/.ci-runs-tests.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -ex -env -if [ "$STEP" = "tests" ]; then - py.test --version - export PYTHONPATH=. - pip install -e . - py.test --cov=bmemcached - exit 0 -fi - -if [ "$STEP" = "lint" ]; then - ruff check . - ruff format --check . - exit 0 -fi - -echo "Unknown step: $STEP" -exit 1 diff --git a/.github/workflows/tests-and-lint.yml b/.github/workflows/tests-and-lint.yml index 2578210..c175c47 100644 --- a/.github/workflows/tests-and-lint.yml +++ b/.github/workflows/tests-and-lint.yml @@ -6,39 +6,67 @@ on: pull_request: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + jobs: tests: runs-on: ubuntu-latest + timeout-minutes: 15 strategy: - max-parallel: 4 + fail-fast: false matrix: # Keep every version quoted. Unquoted 3.10 parses as the float 3.1. python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - STEP="tests" ./.ci-before-script.sh - - name: Run tests or lint + cache: pip + + - name: Install memcached + run: sudo apt-get update && sudo apt-get install -y memcached + + - name: Install dependencies run: | - STEP="tests" ./.ci-runs-tests.sh + python -m pip install --upgrade pip + pip install -e . + pip install --group test + + - name: Run tests + run: pytest --cov=bmemcached --cov-report=xml --cov-report=term + + - name: Upload coverage report + if: matrix.python-version == '3.12' + uses: actions/upload-artifact@v4 + with: + name: coverage-xml + path: coverage.xml + lint: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 + - uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 with: - python-version: "3.10" - - name: Install Dependencies - run: | - STEP="lint" ./.ci-before-script.sh - - name: Run tests or lint + python-version: "3.12" + cache: pip + + - name: Run ruff run: | - STEP="lint" ./.ci-runs-tests.sh + python -m pip install --upgrade pip + pip install ruff + ruff check . + ruff format --check . diff --git a/renovate.json b/renovate.json index 5db72dd..c347a6d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,35 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:recommended" + "config:recommended", + ":semanticCommits", + ":semanticCommitTypeAll(chore)" + ], + "timezone": "Europe/Berlin", + "schedule": ["before 6am on monday"], + "enabledManagers": [ + "github-actions", + "pep621", + "pre-commit", + "nix" + ], + "pre-commit": { + "enabled": true + }, + "lockFileMaintenance": { + "enabled": true + }, + "packageRules": [ + { + "description": "Group every patch and minor update into one pull request.", + "matchUpdateTypes": ["minor", "patch", "digest"], + "groupName": "all non-major updates", + "groupSlug": "all-minor-patch" + }, + { + "description": "Keep each major update in its own pull request.", + "matchUpdateTypes": ["major"], + "dependencyDashboardApproval": true + } ] } From dad093f5d208f5458fdbcba8eb63bd1471258578 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 19 Sep 2026 19:31:56 +0000 Subject: [PATCH 2/3] fix: include pip_requirements in Renovate enabledManagers Allow Renovate to update docs/docs_requirements.txt. Co-authored-by: Jayson Reis --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index c347a6d..3fba226 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ "enabledManagers": [ "github-actions", "pep621", + "pip_requirements", "pre-commit", "nix" ], From 8e7503f5393ff82142bcbece22525a3d1475415e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 19 Sep 2026 19:48:40 +0000 Subject: [PATCH 3/3] ci: install the pinned lint group in CI Use the project lint dependency group so the workflow runs the same Ruff version as local development instead of the latest unpinned release. Co-authored-by: Jayson Reis --- .github/workflows/tests-and-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-and-lint.yml b/.github/workflows/tests-and-lint.yml index c175c47..98b67cd 100644 --- a/.github/workflows/tests-and-lint.yml +++ b/.github/workflows/tests-and-lint.yml @@ -67,6 +67,6 @@ jobs: - name: Run ruff run: | python -m pip install --upgrade pip - pip install ruff + pip install --group lint ruff check . ruff format --check .