Use Pixi in macOS-intel CI #10188
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: 'Tests' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
| cancel-in-progress: true | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: ["main", "maint/*"] | |
| pull_request: | |
| branches: ["main", "maint/*"] | |
| # adapted from spyder-ide/spyder | |
| workflow_dispatch: | |
| inputs: | |
| ssh: | |
| description: 'Enable ssh debugging' | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: read | |
| jobs: | |
| style: | |
| name: Style | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - uses: pre-commit/action@v3.0.1 | |
| - run: pip install mypy numpy scipy vulture | |
| - run: mypy | |
| - run: vulture | |
| bandit: | |
| name: Bandit | |
| needs: style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: davidslusser/actions_python_bandit@v1.0.1 | |
| with: | |
| src: "mne" | |
| options: "-c pyproject.toml -ll -r" | |
| pip_install_command: "pip install bandit[toml]" | |
| pytest: | |
| name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}' | |
| needs: style | |
| timeout-minutes: 120 | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| env: | |
| PYTHON_VERSION: '${{ matrix.python }}' | |
| MKL_NUM_THREADS: '1' | |
| OPENBLAS_NUM_THREADS: '1' | |
| OMP_NUM_THREADS: '1' | |
| PYTHONUNBUFFERED: '1' | |
| MNE_CI_KIND: '${{ matrix.kind }}' | |
| CI_OS_NAME: '${{ matrix.os }}' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| python: '3.13' | |
| kind: pip | |
| - os: ubuntu-latest | |
| python: '3.14' | |
| kind: pip-pre | |
| - os: ubuntu-latest | |
| python: '3.13' | |
| kind: conda | |
| - os: macos-latest # arm64 (Apple Silicon): Sequoia | |
| python: '3.13' | |
| kind: mamba | |
| - os: macos-15-intel # intel: Sequoia | |
| python: '3.13' | |
| kind: pixi | |
| - os: windows-latest | |
| python: '3.11' | |
| kind: mamba | |
| - os: ubuntu-latest | |
| python: '3.12' | |
| kind: minimal | |
| - os: ubuntu-22.04 | |
| python: '3.10' | |
| kind: old | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Get commit message | |
| run: echo "COMMIT_MESSAGE=$(git show -s --format=%s ${{ github.event.pull_request.head.sha || github.sha }})" | tee -a ${GITHUB_ENV} | |
| - 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: 80 | |
| with: | |
| detached: true | |
| - run: ./tools/github_actions_env_vars.sh | |
| # Xvfb/OpenGL | |
| - uses: pyvista/setup-headless-display-action@v4 | |
| with: | |
| qt: true | |
| pyvista: false | |
| wm: false | |
| # Python (if pip) | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| if: startswith(matrix.kind, 'pip') | |
| # Python (if pixi) | |
| - uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| manifest-path: tools/ci/macos-intel/pixi.toml | |
| # https://github.com/prefix-dev/setup-pixi/issues/139 | |
| activate-environment: true | |
| frozen: true | |
| if: matrix.kind == 'pixi' | |
| # Bash login shell on MacOS prepend /usr/bin to PATH, which masks all other installations of Python | |
| - name: Workaround for macOS behavior on login shells | |
| run: echo 'export PATH="${{ github.workspace }}/tools/ci/macos-intel/.pixi/envs/default/bin:$PATH"' | tee -a ~/.bash_profile | |
| if: startsWith(matrix.os, 'macos') && matrix.kind == 'pixi' | |
| - name: Verify that the pixi env is on PATH | |
| if: matrix.kind == 'pixi' | |
| run: | | |
| want="/.pixi/" | |
| got="$(which python)" | |
| if [[ "$got" != *"$want"* ]]; then | |
| echo "Python is NOT running from a virtual environment." | |
| echo "Got : $got" | |
| exit 1 | |
| fi | |
| # Python (if conda) | |
| - name: Fixes for conda | |
| run: | | |
| # For some reason on Linux we get crashes | |
| if [[ "$RUNNER_OS" == "Linux" ]]; then | |
| sed -i "/numba/d" environment.yml | |
| fi | |
| # And on Windows and macOS PySide6.9.0 segfaults | |
| if [[ "$RUNNER_OS" == "macOS" ]]; then | |
| sed -i "" "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml | |
| sed -i "" "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml | |
| else | |
| sed -i "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml | |
| sed -i "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| echo "MNE_IS_OSMESA=true" | tee -a $GITHUB_ENV | |
| fi | |
| fi | |
| if: matrix.kind == 'conda' || matrix.kind == 'mamba' | |
| - uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| environment-file: ${{ env.CONDA_ENV }} | |
| environment-name: mne | |
| log-level: ${{ runner.debug == '1' && 'debug' || 'info' }} | |
| create-args: >- | |
| python=${{ env.PYTHON_VERSION }} | |
| -v | |
| if: matrix.kind == 'conda' || matrix.kind == 'mamba' | |
| timeout-minutes: 20 | |
| # Python (if old) | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: ">=0.9" | |
| activate-environment: true | |
| cache-dependency-glob: | | |
| **/pylock.ci-old.toml | |
| python-version: ${{ matrix.python }} | |
| if: matrix.kind == 'old' | |
| - run: bash ./tools/github_actions_dependencies.sh | |
| - run: python ./tools/github_actions_check_old_env.py | |
| if: matrix.kind == 'old' | |
| # Minimal commands on Linux (macOS stalls) | |
| - run: bash ./tools/get_minimal_commands.sh | |
| if: startswith(matrix.os, 'ubuntu') && matrix.kind != 'minimal' && matrix.kind != 'old' | |
| - run: bash ./tools/github_actions_infos.sh | |
| # Check Qt | |
| - run: bash ./tools/check_qt_import.sh $MNE_QT_BACKEND | |
| if: env.MNE_QT_BACKEND != '' | |
| - name: Run tests with no testing data | |
| run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" --tb=short --cov=mne --cov-report xml -vv -rfE mne/ | |
| if: matrix.kind == 'minimal' | |
| - run: ./tools/get_testing_version.sh | |
| - uses: actions/cache@v5 | |
| with: | |
| key: ${{ env.TESTING_VERSION }} | |
| path: ~/mne_data | |
| - run: bash ./tools/github_actions_download.sh | |
| - run: bash ./tools/github_actions_test.sh # for some reason on macOS we need to run "bash X" in order for a failed test run to show up | |
| - uses: codecov/codecov-action@v6 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| if: success() || failure() |