-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash.sh
More file actions
62 lines (52 loc) · 1.41 KB
/
bash.sh
File metadata and controls
62 lines (52 loc) · 1.41 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
git checkout -b add/requirements-and-notebook-ci
# create requirements.txt with the content above
cat > requirements.txt <<'EOF'
pandas>=2.0
numpy>=1.24
matplotlib>=3.6
seaborn>=0.12
ipython
notebook
nbconvert
pytest
nbval
EOF
# create workflow file
mkdir -p .github/workflows
cat > .github/workflows/notebook-ci.yml <<'EOF'
name: Notebook CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
execute-notebook:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install jupyter
- name: Execute combined notebook
run: |
mkdir -p executed_notebooks
jupyter nbconvert --to notebook --execute notebook/Notebook.ipynb \
--ExecutePreprocessor.timeout=600 \
--output executed_notebooks/executed-Notebook.ipynb
EOF
git add requirements.txt .github/workflows/notebook-ci.yml
git commit -m "Add requirements.txt and notebook CI (execute notebook via nbconvert)"
git push origin add/requirements-and-notebook-ci
# then open a PR on GitHub from this branch to main