-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathdocs-website-test-docs-snippets.yml
More file actions
63 lines (53 loc) · 1.88 KB
/
docs-website-test-docs-snippets.yml
File metadata and controls
63 lines (53 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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"
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 }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SERPERDEV_API_KEY: ${{ secrets.SERPERDEV_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}
- 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
- 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@3cda73b77a148f16f703274198e7771340cf862b # v1
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }}