Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ci

# Runs the local checks of the README on every push to main and on pull requests.
# Actions are pinned by commit SHA, with the version in a comment.

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

# A new push to a pull request cancels the run it replaces. Every other run has a group of its own.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: py${{ matrix.python }}${{ matrix.lint && ', lint, types and build' || '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# The oldest and the newest Python the package supports. The lint, type and build checks run once.
- python: "3.10"
- python: "3.14"
lint: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
# The dev tools are a PEP 735 dependency group, which pip installs from version 25.1.
- run: python -m pip install --upgrade "pip>=25.1"
- run: pip install -e . --group dev
- run: pytest -q
- if: matrix.lint
run: ruff check .
- if: matrix.lint
run: ruff format --check .
- if: matrix.lint
run: mypy
- if: matrix.lint
run: |
pip install build twine
python -m build
twine check dist/*
65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: publish

# Publishes to PyPI when a GitHub Release is published. Provenance:
# faxforagents/sdk-python/.github/workflows/publish.yml (2026-11-17), actions pinned by SHA.
#
# PyPI Trusted Publishing (OIDC): no API token is stored anywhere. PyPI verifies this workflow's
# identity. One-time setup on PyPI (Manage project, Publishing, Add a trusted publisher):
# Owner: faxforagents Repository: haystack-tools Workflow name: publish.yml Environment: pypi

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
# The dev tools are a PEP 735 dependency group, which pip installs from version 25.1.
- run: python -m pip install --upgrade "pip>=25.1"
- run: pip install -e . --group dev build twine
- name: Test before publishing
run: pytest -q
- name: Assert the tag matches the package version
if: github.event_name == 'release'
run: |
TAG="${GITHUB_REF_NAME#v}"
PKG="$(python -c 'import tomllib;print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')"
if [ "$TAG" != "$PKG" ]; then
echo "::error::release tag ($TAG) does not match pyproject version ($PKG)"
exit 1
fi
echo "tag and version agree: $PKG"
- run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dist
path: dist/

publish:
name: publish to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/faxforagents-haystack
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
attestations: true
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
</p>

<p align="center">
<a href="https://github.com/faxforagents/haystack-tools/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/faxforagents/haystack-tools/ci.yml?branch=main&label=ci" alt="CI"></a>

<a href="LICENSE"><img src="https://img.shields.io/badge/licence-MIT-1f6feb" alt="MIT licence"></a>

<a href="https://www.python.org"><img src="https://img.shields.io/badge/python-3.10%2B-3776ab" alt="Python 3.10 or later"></a>
Expand Down Expand Up @@ -234,6 +236,7 @@ uv run mypy
uv build
```

CI runs these checks with Python 3.10 and 3.14 on every push to main and on each pull request.
Tests use fake SDK resources and mocked HTTP responses.
They cover validation, approvals, idempotency, untrusted data, serialization, ToolInvoker execution, and the offline Agent.
No live fax is sent during verification.
Expand Down
Loading