-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (45 loc) · 1.38 KB
/
push_pr.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
name: Run code tests on push and pull requests
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tests:
name: Code tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: true
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
environment-file: .github/requirements.yml
auto-activate-base: false
channels: conda-forge
- shell: bash -l {0}
run: |
conda info
conda list
- name: Lint
shell: bash -l {0}
run: |
python -m flake8 src --exclude src/nifti_mrs/standard
- name: Run pytest
shell: bash -l {0}
run: |
pip install .
pytest -k "not with_fsl_mrs" tests
conda install -c conda-forge -c defaults \
-c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ \
fsl_mrs
pip install .
pytest -k "with_fsl_mrs" tests