forked from nilearn/nilearn
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (82 loc) · 3.41 KB
/
nightly_dependencies.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
# 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:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_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: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install and run ruff checks for NPY NPY201
# see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin
# TODO remove when nilearn only use numpy >= 2.0.0
run: |
python -m pip install ruff>0.1.8
ruff check --preview --select NPY201 .
- name: Install tox
if: steps.check-commit-msg.outputs.skip == 'false'
run: python -m pip install tox
- name: Run test suite
if: steps.check-commit-msg.outputs.skip == 'false'
id: nightly
continue-on-error: true
run: tox run -e test_nightly -- nilearn
- 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