-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
91 lines (79 loc) · 2.09 KB
/
.gitlab-ci.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
image: "python:3.8"
# run on branches
.only_branches: &only_branches
only:
- master
- dev
- cli
variables:
RUN: "bidsme"
EXAMPLE_URL: "https://gitlab.uliege.be/CyclotronResearchCentre/Public/bidstools/bidsme/bidsme_example/-/archive/master/"
EXAMPLE_DIR: "bidsme_example-master"
cache:
paths:
- .cache/pip
before_script:
- python --version
- mkdir -p .cache/pip
- pip --cache-dir=.cache/pip install .
- pip --cache-dir=.cache/pip install flake8
- pip --cache-dir=.cache/pip install openpyxl
- pip --cache-dir=.cache/pip install anybadge
- pip --cache-dir=.cache/pip install coverage
stages:
- test
- get_examples
- run_examples
- decoration
flake8:
stage: test
script:
- python -m flake8 bidsme
allow_failure: true
include_test:
stage: test
script:
- $RUN --help
- $RUN --version
- $RUN process --help
- $RUN prepare --help
- $RUN bidsify --help
- $RUN map --help
unittest:
stage: test
script:
- coverage run -m unittest
get_examples:
stage: get_examples
artifacts:
paths:
- $EXAMPLE_DIR
expire_in: 1 day
script:
- wget -nv $EXAMPLE_URL/$EXAMPLE_DIR.tar.gz
- tar -xzf $EXAMPLE_DIR.tar.gz
- ls
<<: *only_branches
example1:
stage: run_examples
script:
- cd $EXAMPLE_DIR/example1
- $RUN prepare source/ renamed/ -r nii=MRI --part-template resources/participants.json --plugin resources/plugins/rename_plugin.py
- mkdir -p bids/code/bidsme
- cp resources/map/bidsmap.yaml bids/code/bidsme/.
- $RUN map renamed/ bids/ --plugin resources/plugins/bidsify_plugin.py
- $RUN process renamed/ bids/ --plugin resources/plugins/process_plugin.py
- $RUN bidsify renamed/ bids/ --plugin resources/plugins/bidsify_plugin.py
<<: *only_branches
badges:
stage: decoration
artifacts:
paths:
- ver.svg
- bids.svg
script:
- anybadge -o --value=$(cat ${CI_PROJECT_DIR}/bidsme/version.txt) --label=version --file=ver.svg --color=blue
- anybadge -o --value=$(bidsme --version-bids) --label=BIDS --file=bids.svg --color=blue
only:
- dev
- tag