[FIX] fix issues regarding using two_sided and negative plotting thre… #151
This file contains 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
--- | |
# Run test suite using the nightly release of Nilearn dependencies. | |
# | |
# .. admonition:: Control via commit message | |
# :class: tip | |
# | |
# This workflow can be controlled if your commit message contains: | |
# | |
# - ```[test nightly]`` runs the workflow on pull-request. | |
# | |
# When running on `main`, if the workflow fails the action will open an issue | |
# using this issue `template <https://github.com/nilearn/nilearn/blob/main/.github/nightly_failure.md>`_. | |
### | |
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/create-an-issue@v2.9.2 | |
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 |