FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
braindecode/.github/workflows/docs.yml at master · braindecode/braindecode · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
braindecode
/
braindecode
Public
Notifications
You must be signed in to change notification settings
Fork
275
Star
1.3k
Code
Issues
84
Pull requests
11
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
braindecode
/
.github
/
workflows
/
docs.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
114 lines (110 loc) · 4.74 KB
Breadcrumbs
braindecode
/
.github
/
workflows
/
docs.yml
Copy path
File metadata and controls
114 lines (110 loc) · 4.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
name
:
docs
concurrency
:
group
:
${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress
:
true
on
:
push
:
branches
:
-
"
master
"
pull_request
:
branches
:
-
'
*
'
#
all branches, including forks
jobs
:
build_docs
:
runs-on
:
ubuntu-latest
env
:
DOCS_EXTRAS
:
docs,moabb,hub,eegprep,typing,viz
HF_TOKEN
:
${{ secrets.HUGGING_FACE_TOKEN }}
steps
:
#
# Install Braindecode
-
name
:
Checking Out Repository
uses
:
actions/checkout@v4
#
Install python
-
uses
:
actions/setup-python@v5
with
:
python-version
:
'
3.12
'
#
Cache MNE Data and HuggingFace Hub weights.
#
Both caches are content-addressed (filenames + checksums for MNE,
#
commit-pinned safetensors for HF), so they only need to rotate when the
#
set of examples/docs inputs changes. That preserves reuse across normal
#
CI runs instead of forcing a brand-new multi-GB cache upload every time.
-
name
:
Create/Restore MNE Data Cache
id
:
cache-mne_data
uses
:
actions/cache@v4
with
:
path
:
~/mne_data
key
:
docs-mne-data-v2-${{ hashFiles('examples/**/*.py', 'docs/**/*.rst', 'docs/**/*.py', 'docs/conf.py') }}
restore-keys
:
|
docs-mne-data-v2-
docs-mne-data-
-
name
:
Create/Restore HuggingFace Cache
uses
:
actions/cache@v4
with
:
path
:
~/.cache/huggingface/hub
key
:
docs-hf-hub-v2-${{ hashFiles('examples/**/*.py', 'docs/**/*.rst', 'docs/**/*.py', 'docs/conf.py') }}
restore-keys
:
|
docs-hf-hub-v2-
docs-hf-hub-
#
Install uv
-
name
:
Install uv
uses
:
astral-sh/setup-uv@v7
with
:
version
:
latest
enable-cache
:
true
cache-dependency-glob
:
"
**/pyproject.toml
"
#
Install with all dependencies for doc build to go through
-
name
:
Install with doc dependencies
env
:
#
CI runners have no GPU; pull the CPU-only torch wheels instead of the
#
~1.8 GiB CUDA stack. Avoids disk exhaustion and speeds up install.
UV_TORCH_BACKEND
:
cpu
run
:
uv pip install --system -e ".[${{ env.DOCS_EXTRAS }}]"
#
Show Braindecode Version
-
run
:
python -c "import braindecode; print(braindecode.__version__)"
#
Persist HF token to disk so sphinx-gallery examples can access gated repos
-
name
:
Login to Hugging Face Hub
if
:
${{ env.HF_TOKEN != '' }}
run
:
python -c "import os; from huggingface_hub import login; login(token=os.environ['HF_TOKEN'])"
-
name
:
Create Docs
env
:
#
DANCE alone peaks near 8.5 GB; do not use auto gallery workers.
BRAINDECODE_DOCS_JOBS
:
"
2
"
run
:
|
# Configure MNE before workers can race on first-use config creation.
mkdir -p ~/mne_data
python -c "import os, mne; mne.set_config('MNE_DATA', os.path.expanduser('~/mne_data'))"
# Gallery workers can import MOABB examples concurrently; finish NEMAR downloads and legacy-file materialization first.
python -c "from moabb.datasets import BNCI2014_001; BNCI2014_001().get_data([1, 2, 3])"
cd docs
# memory_profiler cannot start its monitor inside a loky worker.
# The full pass reuses this example's same-build gallery result.
BRAINDECODE_DOCS_JOBS=1 make html SPHINXOPTS="-j auto -D sphinx_gallery_conf.filename_pattern=plot_benchmark_preprocessing.py"
make html SPHINXOPTS="-j auto"
-
name
:
Generate Notebooks from Examples
run
:
|
set -euo pipefail
echo "Converting Python examples to notebooks in docs/_build/html/auto_examples/_notebooks..."
mkdir -p docs/_build/html/auto_examples/_notebooks
find examples -type f -name '*.py' | while read -r f; do
rel="${f#examples/}"
out_dir="docs/_build/html/auto_examples/_notebooks/$(dirname "$rel")"
mkdir -p "$out_dir"
base="$(basename "$rel" .py)"
out_path="$out_dir/$base.ipynb"
python .github/scripts/convert_to_notebook.py --input "$f" --output "$out_path"
done
-
name
:
Upload HTML Docs as Artifacts
uses
:
actions/upload-artifact@v4
with
:
name
:
HTML-Docs
path
:
./docs/_build/
-
name
:
Deploy to Github Pages if on Master
if
:
${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses
:
peaceiris/actions-gh-pages@v3
with
:
deploy_key
:
${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository
:
braindecode/braindecode.github.io
destination_dir
:
dev
publish_branch
:
master
publish_dir
:
./docs/_build/html
cname
:
braindecode.org
Back
|
FazBrowse Home
|
New Git URL