Skip to content

Bump astral-sh/setup-uv from 4 to 5 (#5000) #103

Bump astral-sh/setup-uv from 4 to 5 (#5000)

Bump astral-sh/setup-uv from 4 to 5 (#5000) #103

---
# Workflow to test against the latest nightly releases of development versions of our dependencies
name: test on nightly dependencies
on:
push:
branches:
- main
# commits message must include "[test nightly]" to trigger the workflow on PR
pull_request:
branches:
- '*'
schedule:
# Run every monday at 8am UTC
- cron: 0 8 * * 1
workflow_dispatch:
# Force to use color
env:
FORCE_COLOR: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nightly:
# This prevents this workflow from running on a fork.
# To test this workflow on a fork, uncomment the following line.
if: github.repository == 'nilearn/nilearn'
runs-on: ubuntu-latest
steps:
- name: Checkout nilearn
uses: actions/checkout@v4
with:
# If pull request, checkout HEAD commit with all commit history
ref: ${{ github.event.pull_request.head.sha }}
- name: For PRs check if commit message contains [test nightly]
id: check-commit-msg
run: |
set -e -x
commit_msg=$(git log -2 --format=oneline);
if [ "$GITHUB_REF_NAME" == "main" ]; then
echo "run test on nightly releases of nilearn dependencies"
echo "skip=false" >> $GITHUB_OUTPUT
else
if [[ $commit_msg == *"[test nightly]"* ]]; then
echo "run test on nightly releases of nilearn dependencies"
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "skip test on nightly releases of nilearn dependencies"
echo "skip=true" >> $GITHUB_OUTPUT
fi;
fi;
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install tox
if: steps.check-commit-msg.outputs.skip == 'false'
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
- name: Run test suite
if: steps.check-commit-msg.outputs.skip == 'false'
id: nightly
continue-on-error: true
run: tox run --list-dependencies -e nightly -- nilearn
- name: Upload test report
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: nightly_report.html
path: report.html
- name: Create issue
# Do not open issues when on a PR
# because the result will be visible in the PR CI report
if: ${{ github.event_name != 'pull_request' && steps.nightly.outcome != 'success' }}
uses: JasonEtco/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
run_id: ${{ github.run_id }}
repository: ${{ github.repository }}
with:
filename: .github/nightly_failure.md
update_existing: true
search_existing: open
- name: Return failure
if: ${{ steps.check-commit-msg.outputs.skip == 'false' && steps.nightly.outcome != 'success' }}
run: exit 1