Skip to content

test minimal version of each dependency #1

test minimal version of each dependency

test minimal version of each dependency #1

---
# This workflow is automatically run once a month.
#
# Checks that installing the minimum version of a given dependency of Nilearn
# along with the latest version of all the other dependencies leads to a successful run of all the tests.
#
# .. seealso::
#
# https://github.com/nilearn/nilearn/issues/4069
#
###
name: test minimal version of each dependency
on:
schedule:
# Uses the cron schedule for github actions
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
# Runs at 00:00, on day 1 of every 3rd month
- cron: 0 0 1 */3 *
# This enables manual triggering from GitHub UI
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Force to use color
env:
FORCE_COLOR: true
jobs:
test_min_install:
if: github.repository == 'nilearn/nilearn'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10']
min_dep: [joblib==1.2.0, nibabel==5.2.0, numpy==1.26.0, pandas==2.3.0, scikit-learn==1.5.0, scipy==1.11.1, matplotlib==3.8.0, plotly==6.1.1]
name: ${{ matrix.os }} with Python ${{ matrix.python-version }} and ${{ matrix.min_dep }}
steps:
- name: Checkout nilearn
uses: actions/checkout@v6
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for building Nilearn
run: |
python -m pip install --upgrade pip
- name: Install nilearn
run: |
pip install .[plotting] --group test
pip install ${{ matrix.min_dep }}
- name: Run tests
id: test_minimum
# do not run flaky tests when testing minimum version of dependencies
continue-on-error: true
run: |
pytest -m "not flaky and not single_process" --pyargs nilearn --report=report.html --numprocesses auto
pytest -m "not flaky and single_process" --pyargs nilearn
- name: Upload test report
if: success() || failure()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.os }}_${{ matrix.min_dep }}_report.html
path: report.html
- name: Create issue
if: ${{ steps.test_minimum.outcome != 'success' }}
uses: JasonEtco/create-an-issue@v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ github.run_id }}
repository: ${{ github.repository }}
workflow_name: TEST MINIMUM DEPENDENCIES
with:
filename: .github/workflow_failure.md
update_existing: true
search_existing: open
- name: Return failure
if: ${{ steps.test_minimum.outcome != 'success' }}
run: exit 1