-
Notifications
You must be signed in to change notification settings - Fork 345
52 lines (41 loc) · 1.31 KB
/
examples_check.yml
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
name: Notebook Execution and Error Check
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: # This enables manual triggering
jobs:
execute_notebooks:
runs-on: ubuntu-latest
env:
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.x
- name: Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: make full; pip install openai==0.28.1 jupyter nbconvert; pip install .; pip show pypdfium2;
- name: Check for pypdfium2
run: pip show pypdfium2
- name: Execute notebooks and check for errors
run: |
cd docs/examples
pip show pypdfium2
for notebook in $(ls *.ipynb); do
pip show pypdfium2
jupyter nbconvert --to notebook --execute "$notebook"
if [ $? -ne 0 ]; then
echo "Error found in $notebook"
exit 1
fi
done