-
Notifications
You must be signed in to change notification settings - Fork 505
197 lines (170 loc) · 5.97 KB
/
docs-checker.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Docs checker
on:
push:
branches:
- '*'
schedule:
- cron: '0 9 * * 2'
workflow_dispatch:
jobs:
spellcheck:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install pyspelling
- name: Install Aspell
run: |
sudo apt-get install aspell aspell-en
- name: Spellcheck Markdown files
run: |
pyspelling -c .github/.pyspelling.yaml
README-link-checker:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install markdown-link-check
run: npm install -g markdown-link-check
- name: Check links in README.md
run: markdown-link-check README.md
docs-link-checker:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y linkchecker
- name: Check links
id: linkcheck
run: linkchecker https://docs.lavague.ai/en/latest/
bullet-points-format-checker:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run markdown formatting check
run: |
chmod +x .github/bullet-points.sh
.github/bullet-points.sh
lavague-qa-checker:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LAVAGUE_TELEMETRY: "NONE"
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install lavague-qa
wget https://raw.githubusercontent.com/lavague-ai/LaVague/main/lavague-qa/features/demo_amazon.feature
- name: Check QA command
run: |
lavague-qa --headless --url https://www.amazon.fr --feature ./demo_amazon.feature
docs-examples-checker:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
LAVAGUE_TELEMETRY: "NONE"
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
pip cache purge
pip install lavague
pip install pyarrow
pip install lavague-contexts-gemini
pip install llama-index-multi-modal-llms-anthropic
pip install lavague-contexts-fireworks
pip install llama-index-embeddings-huggingface
pip install llama-index-llms-groq
pip install ipython>=7.34.0
pip install text_generation
wget https://raw.githubusercontent.com/lavague-ai/LaVague/main/examples/knowledge/doctolib_knowledge.txt
wget https://raw.githubusercontent.com/lavague-ai/LaVague/main/examples/knowledge/hf_knowledge.txt
- name: Extract Python code
run: |
python .github/extract-python-code.py ./docs/docs/examples/*.md docs/docs/use-cases/*.md ./docs/docs/get-started/*.md ./docs/docs/module-guides/*.md ./docs/docs/learn/*.md
- name: Run extracted Python scripts
run: |
if [ -f generated_scripts.txt ]; then
overall_status=0
while IFS= read -r script_file
do
echo "Running $script_file"
cat "$script_file"
python "$script_file"
if [ $? -ne 0 ]; then
echo "Script $script_file failed"
overall_status=1
fi
done < generated_scripts.txt
if [ $overall_status -ne 0 ]; then
echo "One or more scripts failed."
exit 1
else
echo "All scripts ran successfully."
fi
else
echo "No generated scripts found."
fi
notify-docs-examples-failure:
runs-on: ubuntu-latest
needs: docs-examples-checker
if: failure()
steps:
- name: Notify Discord on docs-examples failure
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"<@762664509813817345> Cron job for 'docs-examples-checker' failed\"}" \
${{ secrets.DOCS_DISCORD_WEBHOOK }}
notify-lavague-qa-failure:
runs-on: ubuntu-latest
needs: lavague-qa-checker
if: failure()
steps:
- name: Notify Discord on docs-examples failure
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"<@762664509813817345> Cron job for 'lavague-qa-checker' failed\"}" \
${{ secrets.DOCS_DISCORD_WEBHOOK }}
notify-docs-links-failure:
runs-on: ubuntu-latest
needs: [docs-link-checker, README-link-checker]
if: failure()
steps:
- name: Notify Discord on docs-links failure
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"<@762664509813817345> Cron job for 'docs-link-checker' or 'README-link-checker' failed\"}" \
${{ secrets.DOCS_DISCORD_WEBHOOK }}
notify-checks-success:
runs-on: ubuntu-latest
needs: [docs-link-checker, docs-examples-checker]
if: success()
steps:
- name: Notify Discord on successful checks
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"<@762664509813817345> Checks successfully passed\"}" \
${{ secrets.DOCS_DISCORD_WEBHOOK }}