c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Docker image release / Build base image (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
75 lines
2.2 KiB
YAML
75 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
|
|
|
|
env:
|
|
HATCH_VERSION: "1.16.5"
|
|
PYTHON_VERSION: "3.11"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-docs-snippets:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
|
|
AZURE_OPENAI_AD_TOKEN: ${{ secrets.AZURE_OPENAI_AD_TOKEN }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
CORE_AZURE_CS_ENDPOINT: ${{ secrets.CORE_AZURE_CS_ENDPOINT }}
|
|
HF_API_TOKEN: ${{ secrets.HUGGINGFACE_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
SERPERDEV_API_KEY: ${{ secrets.SERPERDEV_API_KEY }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install system dependencies
|
|
run: sudo apt-get install -y ffmpeg
|
|
|
|
- name: Install Hatch
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install hatch==${{ env.HATCH_VERSION }} --uploaded-prior-to=P1D
|
|
|
|
- name: Generate API reference for Docusaurus
|
|
run: hatch run docs
|
|
|
|
- name: Install base dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install requests toml --uploaded-prior-to=P1D
|
|
|
|
- name: Run snippet tests (verbose)
|
|
shell: bash
|
|
run: |
|
|
hatch -e test env run -- python docs-website/scripts/test_python_snippets.py --verbose tmp_api_reference/
|
|
|
|
notify-slack-on-failure:
|
|
if: failure() && github.ref_name == 'main'
|
|
needs:
|
|
- test-docs-snippets
|
|
runs-on: ubuntu-slim
|
|
steps:
|
|
- uses: deepset-ai/notify-slack-action@a65def0c8bf91d6520286ab34280151c76a5a008 # v1.1.0
|
|
with:
|
|
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }}
|