10
10
on :
11
11
push :
12
12
branches : [ main ]
13
- tags : [ '*' ]
14
13
pull_request :
15
14
branches : [ main ]
16
15
@@ -19,101 +18,85 @@ jobs:
19
18
runs-on : ubuntu-latest
20
19
strategy :
21
20
matrix :
22
- python-version : ['3.7', '3.11'] # Check oldest and newest versions
23
- pip-flags : ['', '--editable']
21
+ python-version : [ '3.7', '3.11' ] # Check oldest and newest versions
22
+ pip-flags : [ '', '--editable' ]
24
23
pydra :
25
- - ' pydra'
26
- - ' --editable git+https://github.com/nipype/pydra.git#egg=pydra'
24
+ - ' pydra'
25
+ - ' --editable git+https://github.com/nipype/pydra.git#egg=pydra'
27
26
28
27
steps :
29
- - uses : actions/checkout@v2
30
- - name : Set up Python ${{ matrix.python-version }}
31
- uses : actions/setup-python@v2
32
- with :
33
- python-version : ${{ matrix.python-version }}
34
- - name : Install build dependencies
35
- run : |
36
- python -m pip install --upgrade pip
37
- - name : Install Pydra
38
- run : |
39
- pip install ${{ matrix.pydra }}
40
- python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
41
- - name : Install task package
42
- run : |
43
- pip install ${{ matrix.pip-flags }} ".[dev]"
44
- python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
45
- python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
28
+ - uses : actions/checkout@v2
29
+ - name : Set up Python ${{ matrix.python-version }}
30
+ uses : actions/setup-python@v2
31
+ with :
32
+ python-version : ${{ matrix.python-version }}
33
+ - name : Install build dependencies
34
+ run : |
35
+ python -m pip install --upgrade pip
36
+ - name : Install Pydra
37
+ run : |
38
+ pip install ${{ matrix.pydra }}
39
+ python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
40
+ - name : Install task package
41
+ run : |
42
+ pip install ${{ matrix.pip-flags }} ".[dev]"
43
+ python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
44
+ python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
46
45
47
46
test :
48
47
runs-on : ubuntu-latest
49
48
strategy :
50
49
matrix :
51
- python-version : ['3.7', '3.8', '3.9', '3.10', '3.11']
50
+ python-version : [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
52
51
53
52
steps :
54
- - uses : actions/checkout@v2
55
- - name : Set up Python ${{ matrix.python-version }}
56
- uses : actions/setup-python@v2
57
- with :
58
- python-version : ${{ matrix.python-version }}
59
- - name : Set up NeuroDebian
60
- run : bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
61
- - name : Install FSL
62
- run : sudo apt-get install -y fsl
63
- - name : Install build dependencies
64
- run : |
65
- python -m pip install --upgrade pip
66
- - name : Install task package
67
- run : |
68
- pip install ".[test]"
69
- python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
70
- python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
71
- - name : Test with pytest
72
- run : |
73
- source /etc/fsl/fsl.sh
74
- pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
75
- --cov pydra.tasks.$SUBPACKAGE --cov-report xml
76
- - uses : codecov/codecov-action@v1
77
- if : ${{ always() }}
53
+ - uses : actions/checkout@v2
54
+ - name : Set up Python ${{ matrix.python-version }}
55
+ uses : actions/setup-python@v2
56
+ with :
57
+ python-version : ${{ matrix.python-version }}
58
+ - name : Set up NeuroDebian
59
+ run : bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
60
+ - name : Install FSL
61
+ run : sudo apt-get install -y fsl
62
+ - name : Install build dependencies
63
+ run : |
64
+ python -m pip install --upgrade pip
65
+ - name : Install task package
66
+ run : |
67
+ pip install ".[test]"
68
+ python -c "import pydra.tasks.$SUBPACKAGE as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
69
+ python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
70
+ - name : Test with pytest
71
+ run : |
72
+ source /etc/fsl/fsl.sh
73
+ pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
74
+ --cov pydra.tasks.$SUBPACKAGE --cov-report xml
75
+ - uses : codecov/codecov-action@v1
76
+ if : ${{ always() }}
78
77
79
78
deploy :
80
- needs : [devcheck, test]
79
+ needs : [ devcheck, test ]
81
80
runs-on : ubuntu-latest
82
81
strategy :
83
82
matrix :
84
- python-version : [3.9]
83
+ python-version : [ ' 3.9' ]
85
84
steps :
86
- - uses : actions/checkout@v2
87
- with :
88
- submodules : recursive
89
- fetch-depth : 0
90
- - name : Set up Python ${{ matrix.python-version }}
91
- uses : actions/setup-python@v2
92
- with :
93
- python-version : ${{ matrix.python-version }}
94
- - name : Install build tools
95
- run : python -m pip install build twine
96
- - name : Build source and wheel distributions
97
- run : python -m build
98
- - name : Check distributions
99
- run : twine check dist/*
100
- - uses : actions/upload-artifact@v2
101
- with :
102
- name : distributions
103
- path : dist/
104
- # Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
105
- # Secrets are not accessible in the if: condition [0], so set an output variable [1]
106
- # [0] https://github.community/t/16928
107
- # [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
108
- - name : Check for PyPI token on tag
109
- id : deployable
110
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
111
- env :
112
- PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
113
- run : if [ -n "$PYPI_API_TOKEN" ]; then echo ::set-output name=DEPLOY::true; fi
114
- - name : Upload to PyPI
115
- if : steps.deployable.outputs.DEPLOY
116
- uses : pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 # v1.4.2
117
- with :
118
- user : __token__
119
- password : ${{ secrets.PYPI_API_TOKEN }}
85
+ - uses : actions/checkout@v2
86
+ with :
87
+ submodules : recursive
88
+ fetch-depth : 0
89
+ - name : Set up Python ${{ matrix.python-version }}
90
+ uses : actions/setup-python@v2
91
+ with :
92
+ python-version : ${{ matrix.python-version }}
93
+ - name : Install build tools
94
+ run : python -m pip install build twine
95
+ - name : Build source and wheel distributions
96
+ run : python -m build
97
+ - name : Check distributions
98
+ run : twine check dist/*
99
+ - uses : actions/upload-artifact@v2
100
+ with :
101
+ name : distributions
102
+ path : dist/
0 commit comments