-
Notifications
You must be signed in to change notification settings - Fork 111
70 lines (60 loc) · 2 KB
/
python_tests.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
name: Python tests
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set git name/email
run: |
git config --global user.email "bids.maintenance@gmail.com"
git config --global user.name "bids-maintenance"
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install git-annex ubuntu
if: matrix.platform == 'ubuntu-latest'
shell: bash -l {0}
run: conda install -c conda-forge git-annex
- name: Install git-annex macos
if: matrix.platform == 'macos-latest'
shell: bash -l {0}
run: brew install git-annex
- name: Install git-annex windows
if: matrix.platform == 'windows-latest'
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install git-annex --yes --ignore-checksums
continue-on-error: true # This can fail for stupid reasons ¯\_(ツ)_/¯
- name: Install remaining dependencies
shell: bash -l {0}
run: |
which python
pip install datalad
pip install pytest pytest-sugar flake8 pydocstyle
pip install -e ./bids-validator
- name: Check formatting
shell: bash -l {0}
run: |
cd bids-validator
flake8 bids_validator
pydocstyle bids_validator/bids_validator.py
- name: Test with pytest
shell: bash -l {0}
run: |
cd bids-validator
pytest --doctest-modules bids_validator --verbose