-
Notifications
You must be signed in to change notification settings - Fork 28
44 lines (43 loc) · 1.51 KB
/
stubs.yaml
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
name: stubs
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
generate:
timeout-minutes: 10
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- run: sudo apt update && sudo apt install -y binutils libpugixml-dev
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: astral-sh/setup-uv@v3
- run: uv pip install -e .[stubs] --quiet --system
- run: mne-lsl sys-info --developer
- run: python tools/stubgen.py
- name: Push stub files
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
if [ -n "$(git status --porcelain)" ]; then
branch_name="update-stub-files-$(date +'%Y%m%d-%H%M%S')"
git checkout -b "$branch_name"
git add mne_lsl/\*.pyi
git commit -m "deploy stub files [ci skip]"
git push --set-upstream origin "$branch_name"
gh pr create --title "Update stub files" --body "Auto-generated PR for updating stub files." --base main
fi