-
-
Notifications
You must be signed in to change notification settings - Fork 199
75 lines (64 loc) · 2.1 KB
/
execute-notebooks.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Execute notebooks
on:
# Run on demand
workflow_dispatch:
# 6.49 am (GMT) every Monday; time chosen at random
schedule:
- cron: "49 6 * * MON"
# Limit workflow permissions
permissions:
contents: read
# Limit simultaneous workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
jobs:
execute:
name: Update notebooks
if: github.repository_owner == 'Econ-ARK'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10" # Numba doesn't support Python 3.11 [2023-05]
cache: "pip"
cache-dependency-path: |
requirements/base.txt
.github/workflows/execute-notebooks.yml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
# For LabeledModels.ipynb
python -m pip install estimagic
# For nbstripout
python -m pip install nbstripout
# For nb_exec.py
python -m pip install ipykernel nbclient nbformat
- name: Strip output
run: nbstripout examples/**/*.ipynb
# This step takes c. 20 minutes
- name: Execute notebooks
run: python tools/nb_exec.py examples/**/*.ipynb
env:
PYTHONUNBUFFERED: "1"
- name: Open PR
uses: peter-evans/create-pull-request@v5
with:
author: "Econ-ARK Bot <[email protected]>"
branch: "bot/update-notebooks"
commit-message: "[bot] updated notebooks"
delete-branch: true
title: "[bot] Execute example notebooks"
# language=Markdown
body: >
This PR was [automatically generated] to re-execute
the example notebooks for use in the documentation.
[automatically generated]: https://github.com/Econ-ARK/HARK/actions/workflows/execute-notebooks.yml