Repository navigation
Add the CI and PyPI publish workflows - #9
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 devandpytest -q. The 3.14 entry also runs the README's checks:ruff check .ruff format --check .mypypython -m buildandtwine 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.build: install with the dev group, run the tests, check that the release tag (without a leadingv) equals thepyproject.tomlversion,python -m build,twine check, uploaddist/as an artifact.publish: in thepypienvironment withid-token: write,pypa/gh-action-pypi-publishv1.14.3 with attestations. No token is stored.The PyPI trusted publisher for
faxforagents-haystackneeds ownerfaxforagents, repositoryhaystack-tools, workflowpublish.ymland environmentpypi. PyPI has 0.1.0. The repository is at 0.2.0. Thepypienvironment now exists in this repository, with no protection rules. This PR creates no release.Checked locally
The README checks pass with
uvon 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. Onci.yml:pathsfilter, 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.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.