Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica-mitchell committed Jan 25, 2024
1 parent aba2d9d commit ffc6853
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/convert_to_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Convert examples

on: [push, pull_request]

jobs:
convert_examples:
runs-on: ubuntu-latest

steps:
- name: "Checkout repository content"
uses: actions/checkout@v2

- name: "Set up Python 3.x"
uses: actions/setup-python@v2
with:
python-version: 3.10

- name: "Install Linux system dependencies"
run: |
sudo apt-get update
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
python -m pip install sphinx sphinx-gallery
- name: "Convert to notebooks"
run: |
# mkdir pynest/notebooks
sphx_glr_python_to_jupyter.py $(find copies/examples/ -iname "*.py")
# mv pynest/examples/* pynest/notebooks
grep -rl '"display_name": "Python 3"' pynest/notebooks | xargs sed -i 's/"display_name": "Python 3"/"display_name": "EBRAINS-23.09"/g'
grep -rl '"name": "python3"' pynest/notebooks | xargs sed -i 's/"name": "python3"/"name": "ebrains-23.09"/g'

0 comments on commit ffc6853

Please sign in to comment.