Skip to content

Add the CI and PyPI publish workflows - #9

Merged
bensynapse merged 1 commit into
mainfrom
ci-publish-workflows
Nov 17, 2026
Merged

bensynapse merged 1 commit into
mainfrom
ci-publish-workflows

Conversation

@bensynapse

@bensynapse bensynapse commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This repository had no workflow on push or pull request. This adds two.

ci.yml

Runs on pushes to main, on pull requests and by hand. One job, two matrix entries: Python 3.10, the floor in requires-python, and Python 3.14, the newest the package supports.

Each entry upgrades pip to 25.1 or later, because the dev tools are a PEP 735 dependency group. Then it runs pip install -e . --group dev and pytest -q. The 3.14 entry also runs the README's checks:

  • ruff check .

  • ruff format --check .

  • mypy

  • python -m build and twine check dist/*, so packaging breaks show up here and not at release time.

  • Actions are pinned by commit SHA with the version in a comment. checkout v7.0.1 and setup-python v7.1.0 match sdk-python.

  • permissions: contents: read.

  • A concurrency group: a new push to a pull request cancels the run it replaces. Pushes to main get a group of their own per run.

  • setup-python caches pip, keyed on pyproject.toml.

publish.yml

Copied from faxforagents/sdk-python, with the same pinned actions. It runs when a GitHub Release is published, or by hand.

  1. build: install with the dev group, run the tests, check that the release tag (without a leading v) equals the pyproject.toml version, python -m build, twine check, upload dist/ as an artifact.
  2. publish: in the pypi environment with id-token: write, pypa/gh-action-pypi-publish v1.14.3 with attestations. No token is stored.

The PyPI trusted publisher for faxforagents-haystack needs owner faxforagents, repository haystack-tools, workflow publish.yml and environment pypi. PyPI has 0.1.0. The repository is at 0.2.0. The pypi environment now exists in this repository, with no protection rules. This PR creates no release.

Checked locally

The README checks pass with uv on the locked versions. The CI install path was also run in fresh virtualenvs with pip 26.3 on Python 3.10 and 3.14. Both resolved faxforagents 0.6.1 and passed the tests, and the lint, type and build checks passed on 3.14.

ci-speedup

The repository has no run history yet, so only the static scan applies. It finds nothing in publish.yml. On ci.yml:

  • No paths filter, rated high risk by the tool. Not added. The job is short, and the tests read the README and examples, so a filter would skip changes that can fail them.
  • No draft gating, rated medium. Not added. The job is short.

Measured on this PR

Both jobs passed on the first run. Python 3.10 took 46 s, and Python 3.14 with the lint, type and build checks took 57 s. A re-run took 42 s and 57 s.

pytest takes 12 to 14 s here and mypy 12 s, the rest is the install at 19 to 20 s cold. The re-run restored about 65 MB of pip cache per Python. The install dropped to 14 s on 3.10 and did not change on 3.14. So the cache saves little at this size.

ci.yml runs the README checks with the oldest and newest supported Python on pushes to main and on pull requests.
publish.yml publishes to PyPI through trusted publishing when a GitHub Release is published.
The README gains a CI badge and one line about CI.
@bensynapse
bensynapse merged commit 07d89c9 into main Nov 17, 2026
6 checks passed
@bensynapse
bensynapse deleted the ci-publish-workflows branch November 17, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant