mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-01 01:27:28 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
name: Test Python snippets in docs
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '17 3 * * *' # daily at 03:17 UTC
|
|
workflow_dispatch:
|
|
inputs:
|
|
haystack_version:
|
|
description: 'Haystack version to test against (e.g., 2.16.1, main)'
|
|
required: false
|
|
default: 'main'
|
|
type: string
|
|
|
|
# TEMPORARILY DISABLED
|
|
# push:
|
|
# paths:
|
|
# - 'docs-website/docs/**'
|
|
# - 'docs-website/versioned_docs/**'
|
|
# - 'docs-website/scripts/test_python_snippets.py'
|
|
# - 'docs-website/scripts/generate_requirements.py'
|
|
# - '.github/workflows/docs-website-test-docs-snippets.yml'
|
|
|
|
jobs:
|
|
test-docs-snippets:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
env:
|
|
# TODO: We'll properly set these after migration to core project
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install base dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install requests toml
|
|
|
|
- name: Generate requirements.txt
|
|
run: |
|
|
# Use input version or default to main
|
|
if [ "${{ github.event.inputs.haystack_version }}" != "" ]; then
|
|
VERSION="${{ github.event.inputs.haystack_version }}"
|
|
else
|
|
VERSION="main"
|
|
fi
|
|
echo "Generating requirements.txt for Haystack version: $VERSION"
|
|
python docs-website/scripts/generate_requirements.py --version "$VERSION"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
if [ -f requirements.txt ]; then
|
|
echo "Installing dependencies from requirements.txt"
|
|
pip install -r requirements.txt
|
|
else
|
|
echo "Error: requirements.txt was not generated"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Run snippet tests (verbose)
|
|
run: |
|
|
# TEMPORARY: Testing with single file to make CI green
|
|
# TODO: Expand to run all docs: --paths docs versioned_docs
|
|
python docs-website/scripts/test_python_snippets.py docs-website/reference/haystack-api/agents_api.md
|