-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (144 loc) · 4.6 KB
/
test_template.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: DIPY Base Workflow Template
on:
workflow_call:
inputs:
runs-on:
description: "Select on which environment you want to run the workflow"
type: string
required: false
default: '"ubuntu-latest"'
python-version:
description: "Select Python version"
type: string
required: false
default: '["3.10", ]'
use-pre:
description: "bal"
type: boolean
required: false
coverage:
description: "coverage"
type: boolean
required: false
enable-viz-tests:
description: "Activate viz tests and headless"
type: boolean
required: false
install-type:
description: ""
type: string
required: false
default: '["pip", ]'
depends:
description: ""
type: string
required: false
default: cython!=0.29.29 numpy matplotlib h5py nibabel cvxpy<=1.4.4 tqdm
extra-depends:
description: ""
type: string
required: false
secrets:
codecov-token:
description: "codecov token to send the report"
required: false
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
python-version: ${{fromJSON(inputs.python-version) }}
os: ${{fromJSON(inputs.runs-on) }}
install-type: ${{fromJSON(inputs.install-type) }}
exclude:
- os: macos-14
python-version: 3.9
env:
DEPENDS: ${{ inputs.depends }}
EXTRA_DEPENDS: ${{ inputs.extra-depends }}
INSTALL_TYPE: ${{ matrix.install-type }}
PYTHON_VERSION: ${{ matrix.python-version }}
VENV_ARGS: "--python=python"
USE_PRE: ${{ inputs.use-pre }}
COVERAGE: ${{ inputs.coverage }}
DIPY_WERRORS: 1
CODECOV_TOKEN: ${{ secrets.codecov-token }}
TEST_WITH_XVFB: ${{ inputs.enable-viz-tests }}
PRE_WHEELS: "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" # "https://pypi.anaconda.org/scipy-wheels-nightly/simple"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ matrix.install-type != 'conda' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Virtualenv
if: ${{ matrix.install-type != 'conda' }}
run: |
python -m pip install --upgrade pip virtualenv
virtualenv $VENV_ARGS venv
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
if: ${{ matrix.install-type == 'conda' }}
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: venv
python-version: ${{ matrix.python-version }}
channels: defaults, conda-forge
use-only-tar-bz2: true
- name: Install HDF5 and pytables on macOS
if: ${{ (runner.os == 'macOS') && (env.EXTRA_DEPENDS != '') && (env.INSTALL_TYPE == 'pip') }}
run: |
pip install cython
brew install hdf5
brew install c-blosc
export HDF5_DIR=/opt/homebrew/opt/hdf5
export BLOSC_DIR=/opt/homebrew/opt/c-blosc
pip install tables
- name: Install Dependencies
run: |
if [ "${{ inputs.use-pre }}" == "true" ]; then
tools/ci/install_dependencies.sh || echo "::warning::Experimental Job so Install Dependencies failure ignored!"
else
tools/ci/install_dependencies.sh
fi
- name: Install OpenMP on macOS
if: runner.os == 'macOS'
run: |
brew install llvm
brew install libomp
echo "CC=clang" >> $GITHUB_ENV
- name: Install DIPY
run: |
if [ "${{ inputs.use-pre }}" == "true" ]; then
tools/ci/install.sh || echo "::warning::Experimental Job so Install DIPY failure ignored!"
else
tools/ci/install.sh
fi
- name: Setup Headless
if: ${{ inputs.enable-viz-tests }}
run: tools/ci/setup_headless.sh
- name: Run the Tests
run: |
if [ "${{ inputs.use-pre }}" == "true" ]; then
tools/ci/run_tests.sh || echo "::warning::Experimental Job so failure ignored!"
else
tools/ci/run_tests.sh
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ fromJSON(env.COVERAGE) }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: for_testing
files: coverage.xml
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true