-
Notifications
You must be signed in to change notification settings - Fork 16
103 lines (93 loc) · 2.94 KB
/
travis.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
name: Deps & CI
on:
push:
branches: [ '*' ]
pull_request:
branches: [ master, 'maint/*' ]
schedule:
- cron: '0 0 * * 1'
# Allow job to be triggered manually from GitHub interface
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
cache-test-data:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
env:
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
steps:
- name: Git settings (pacify DataLad)
run: |
git config --global user.name 'NiPreps Bot'
git config --global user.email 'nipreps@gmail.com'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: conda
with:
path: |
/usr/share/miniconda/pkgs
/home/runner/.cache/pip
key: python-${{ matrix.python-version }}-v1
restore-keys: |
python-${{ matrix.python-version }}-
- name: Install DataLad
run: |
$CONDA/bin/conda install -c conda-forge git-annex
python -m pip install datalad datalad-next datalad-osf
- name: Check remote HEAD
run: |
git ls-remote https://gin.g-node.org/oesteban/nitransforms-tests \
| awk '/HEAD/{ print "HEAD=" $1 }' >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ${{ env.TEST_DATA_HOME }}
key: data-cache-v2-${{ env.HEAD }}
restore-keys: |
data-cache-v2-${{ env.HEAD }}
data-cache-v2
- name: Install test data
run: |
export PATH=$CONDA/bin:$PATH
mkdir -p /home/runner/testdata
datalad install -s https://gin.g-node.org/oesteban/nitransforms-tests $TEST_DATA_HOME
datalad update --merge -d $TEST_DATA_HOME
datalad get -J 2 -d $TEST_DATA_HOME
build-linux:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
needs: [cache-test-data]
env:
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ${{ env.TEST_DATA_HOME }}
key: data-cache-v2
restore-keys: |
data-cache-v2
- uses: actions/checkout@v3
- name: Install minimal dependencies
run: |
pip install .[tests]
- name: Run pytest
run: |
pytest -v --cov nitransforms --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules nitransforms/
- name: Submit code coverage
uses: codecov/codecov-action@v3
with:
files: cov.xml