-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
executable file
·64 lines (59 loc) · 1.69 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
stages:
- build
- test
- cleanup
test:
stage: test
script:
- source ~/.bashrc
- conda activate pysyintegration
- pip install --upgrade --no-deps -v -e .
- python -m pytest
except:
- master
build-full:
stage: build
script:
- conda env create -f environment.yml -n pysyintegration_m python --force
- source ~/.bashrc
- conda activate pysyintegration_m
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
test-full:
stage: test
script:
- source ~/.bashrc
- conda activate pysyintegration_m
- pip install --upgrade --no-deps -v -e .
- python -m pytest -c tests/full_run.ini
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
cleanup:
stage: cleanup
script:
- conda remove --yes -n pysyintegration_m --all
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
pylint:
stage: test
before_script:
- source ~/.bashrc
- conda activate pysyintegration_m
- pip install pylint pylint-exit anybadge
script:
- mkdir ./pylint
- pylint --output-format=text syconn | tee ./pylint/pylint.log || pylint-exit $?
- PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
- anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
- echo "Pylint score is $PYLINT_SCORE"
artifacts:
paths:
- ./pylint/
expire_in: 2 yrs
allow_failure: true
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'