SPEC0 #20
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: SPEC0 | |
| on: # yamllint disable-line rule:truthy | |
| schedule: | |
| - cron: '0 0 * * 1' # At 00:00 every Monday | |
| workflow_dispatch: | |
| inputs: | |
| ssh: | |
| description: 'Enable ssh debugging' | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| update_versions: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| name: Update dependency versions | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.MNE_BOT_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.MNE_BOT_TOKEN }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: true | |
| - name: Triage SSH | |
| run: | | |
| if [[ "${{ inputs.ssh }}" == "true" ]] || [[ "$COMMIT_MESSAGE" == *"[actions ssh]"* ]]; then | |
| echo "ENABLE_SSH=true" | tee -a $GITHUB_ENV | |
| else | |
| echo "ENABLE_SSH=false" | tee -a $GITHUB_ENV | |
| fi | |
| - name: Setup Remote SSH Connection | |
| if: env.ENABLE_SSH == 'true' | |
| uses: Warpbuilds/action-debugger@v1.3 | |
| timeout-minutes: 10 | |
| with: | |
| detached: true | |
| - uses: astral-sh/setup-uv@v8.1.0 | |
| with: | |
| version: ">=0.9" | |
| activate-environment: true | |
| python-version: 3.12 | |
| - name: Install dependencies | |
| run: uv pip install -e . packaging requests tomlkit | |
| - name: Update tracked dependencies | |
| run: python ./tools/dev/spec_zero_update_versions.py | |
| - name: Sync updated dependencies to README | |
| run: python tools/sync_dependencies.py | |
| - name: Create lockfile for old CI | |
| # uv pip compile requires setting the python version explicitly in the command :( | |
| run: | | |
| uv pip compile pyproject.toml --python "3.10" --python-platform "x86_64-unknown-linux-gnu" --group test --group lockfile_extras --resolution lowest-direct --format pylock.toml --output-file tools/pylock.ci-old.toml | |
| python tools/github_actions_check_old_lockfile.py | |
| - name: check if files changed | |
| run: | | |
| git diff && git status --porcelain | |
| if [[ $(git status --porcelain) ]]; then | |
| echo "dirty=true" >> $GITHUB_OUTPUT | |
| fi | |
| id: status | |
| - name: Run pre-commit hooks to update other files | |
| run: | | |
| uv pip install pre-commit | |
| pre-commit run --all || true | |
| if: steps.status.outputs.dirty == 'true' | |
| - name: Create PR | |
| run: | | |
| set -xeo pipefail | |
| git diff | |
| git config --global user.email "50266005+mne-bot@users.noreply.github.com" | |
| git config --global user.name "mne[bot]" | |
| git checkout -b spec_zero | |
| if [ -f doc/changes/dev/dependency.rst ]; then | |
| git add doc/changes/dev/dependency.rst # one new file, others changed | |
| fi | |
| git commit -am "mne[bot]: Update dependency specifiers" | |
| git push origin spec_zero | |
| PR_NUM=$(gh pr create --base main --head spec_zero --title "MAINT: Update dependency specifiers" --body "Created by spec_zero [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}). <br> <br> *Adjustments may need to be made to shims in \`mne/fixes.py\` and elswhere in this or another PR. \`make -C tools/dev dep\` is a good starting point for finding potential updates.*") | |
| echo "Opened https://github.com/mne-tools/mne-python/pull/${PR_NUM}" >> $GITHUB_STEP_SUMMARY | |
| if: steps.status.outputs.dirty == 'true' |