Multi score #3008
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build_docs: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| python-version: [ "3.10" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Create/Restore MNE Data Cache | |
| id: cache-mne_data | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/mne_data | |
| key: doc-${{ runner.os }}-mne-data-${{ github.run_id }} | |
| restore-keys: | | |
| doc-${{ runner.os }}-mne-data- | |
| - name: Clean up corrupted cache | |
| run: | | |
| echo "Cache hit: ${{ steps.cache-mne_data.outputs.cache-hit }}" | |
| mkdir -p ~/mne_data | |
| # Remove any incomplete extractions (e.g., BIDS.zip.unzip alongside final folder) | |
| if [ -d ~/mne_data/BIDS.zip.unzip ]; then | |
| echo "Removing incomplete extraction: BIDS.zip.unzip" | |
| rm -rf ~/mne_data/BIDS.zip.unzip | |
| fi | |
| if [ -d ~/mne_data/BrainForm-BIDS-eeg-dataset ] && [ -f ~/mne_data/BrainForm-BIDS-eeg-dataset/.cache-incomplete ]; then | |
| echo "Removing incomplete BrainForm dataset" | |
| rm -rf ~/mne_data/BrainForm-BIDS-eeg-dataset | |
| fi | |
| - name: Cache docs build | |
| id: cache-docs | |
| uses: actions/cache@v3 | |
| with: | |
| key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: docs/build | |
| - name: Install moabb | |
| run: | | |
| uv pip install -e .[docs,deeplearning,optuna,external,carbonemission] | |
| - name: Build docs | |
| run: | | |
| cd docs && make html | |
| - name: Generate notebooks from examples (Colab) | |
| 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 | |
| # Create an artifact of the html output. | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: DocumentationHTML | |
| path: docs/build/html/ | |
| deploy_neurotechx: | |
| if: ${{ github.ref == 'refs/heads/develop' }} | |
| needs: build_docs | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore cached docs build | |
| id: cache-docs | |
| uses: actions/cache/restore@v3 | |
| with: | |
| key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: docs/build | |
| - name: Check cache hit | |
| if: steps.cache-docs.outputs.cache-hit != 'true' | |
| run: exit 1 | |
| - name: Deploy Neurotechx Subpage | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
| external_repository: NeuroTechX/moabb.github.io | |
| destination_dir: docs/ | |
| publish_branch: master | |
| publish_dir: ./docs/build/html | |
| cname: moabb.neurotechx.com/ | |
| deploy_gh_pages: | |
| if: ${{ github.ref == 'refs/heads/develop' }} | |
| needs: build_docs | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore cached docs build | |
| id: cache-docs | |
| uses: actions/cache/restore@v3 | |
| with: | |
| key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: docs/build | |
| - name: Check cache hit | |
| if: steps.cache-docs.outputs.cache-hit != 'true' | |
| run: exit 1 | |
| - name: Deploy gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy_key: ${{ secrets.MOABB_DEPLOY_KEY_NEW }} | |
| destination_dir: docs/ | |
| publish_branch: gh-pages | |
| publish_dir: ./docs/build/html | |
| cname: neurotechx.github.io/moabb/ |