@@ -8,7 +8,7 @@ permissions:
88 contents : read
99
1010jobs :
11- autofix :
11+ autofix-changelog-headers :
1212 name : Autofix and style
1313 runs-on : ubuntu-latest
1414 steps :
2424 - uses : j178/prek-action@v3.0.0
2525 - uses : autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a
2626 if : success() || failure()
27+ changed-files :
28+ name : Check for dependency-relevant changes
29+ runs-on : ubuntu-latest
30+ permissions :
31+ pull-requests : read
32+ outputs :
33+ dependencies : ${{ steps.check.outputs.dependencies }}
34+ steps :
35+ - name : Check whether any dependency input or generated file changed
36+ id : check
37+ env :
38+ GH_TOKEN : ${{ github.token }}
39+ PR_NUMBER : ${{ github.event.pull_request.number }}
40+ REPO : ${{ github.repository }}
41+ run : |
42+ set -eo pipefail
43+ # Also match the generated files themselves, so hand-edits get reverted
44+ PATTERN='^(pyproject\.toml|README\.rst|environment\.yml|tools/pylock\.ci-old\.toml|\.github/workflows/autofix\.yml)$'
45+ # Collect first: `grep -q` exits early, and the resulting SIGPIPE would
46+ # trip `pipefail` precisely when a file does match
47+ FILES=$(gh api --paginate "repos/${REPO}/pulls/${PR_NUMBER}/files" --jq '.[].filename')
48+ if grep -qE "$PATTERN" <<< "$FILES"; then
49+ echo "dependencies=true" | tee -a "$GITHUB_OUTPUT"
50+ else
51+ echo "dependencies=false" | tee -a "$GITHUB_OUTPUT"
52+ fi
53+ autofix-dependencies :
54+ name : Autoupdate 'old' CI lockfile, README dependencies, and environment file
55+ runs-on : ubuntu-latest
56+ needs : changed-files
57+ if : needs.changed-files.outputs.dependencies == 'true'
58+ steps :
59+ - uses : actions/checkout@v7.0.1
60+ with :
61+ persist-credentials : false
62+ - uses : astral-sh/setup-uv@v9.0.0
63+ with :
64+ version : " >=0.9"
65+ activate-environment : true
66+ enable-cache : false
67+ python-version : " 3.12"
68+ - name : Update 'old' CI lockfile
69+ # uv pip compile requires setting the python version for the environment explicitly in the command :(
70+ run : |
71+ uv pip compile pyproject.toml \
72+ --python "3.11" --python-platform "x86_64-unknown-linux-gnu" \
73+ --group test --group lockfile_extras \
74+ --resolution lowest-direct \
75+ --format pylock.toml --output-file tools/pylock.ci-old.toml \
76+ --no-cache
77+ - name : Validate 'old' CI lockfile
78+ uses : mne-tools/mne-tools/actions/check-lockfile@main
79+ with :
80+ project-root : ${{ github.workspace }}
81+ lockfile-path : tools/pylock.ci-old.toml
82+ groups : lockfile_extras
83+ - name : Sync dependencies to README
84+ uses : mne-tools/mne-tools/actions/sync-dependencies-to-readme@main
85+ with :
86+ project-root : ${{ github.workspace }}
87+ ignore-upper-pins : numpy
88+ - name : Sync dependencies to environment file
89+ uses : mne-tools/mne-tools/actions/sync-dependencies-to-environment-file@main
90+ with :
91+ project-root : ${{ github.workspace }}
92+ extras : full,full-no-qt,hdf5
93+ # manually specify extras groups to sync, as logic for recursion into other groups isn't implemented in the action yet (see mne-tools#40)
94+ # e.g., `full` includes `mne[full-no-qt]`, but the action won't recognise this, so we need to specify `full-no-qt` explicitly
95+ # ffmpeg is pinned to work around a conda solver issue (gh-14023)
96+ additional-dependencies : pip,mamba,conda,nomkl,noqt5,ffmpeg==8.1.2
97+ pip-dependencies : pymef
98+ requirements-overrides : PySide6==6.11.1,vtk==9.6.2
99+ - uses : autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a
100+ if : success() || failure()
0 commit comments