-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
36 lines (32 loc) · 929 Bytes
/
.gitlab-ci.yml
File metadata and controls
36 lines (32 loc) · 929 Bytes
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
image: "python:3.8"
before_script:
- python --version
- pip install poetry
- poetry install
stages:
- Static Analysis
- Test
pylint:
stage: Static Analysis
before_script:
- pip install pylint pylint-exit anybadge poetry
tags:
- csiro-swarm
allow_failure: false
script:
- poetry install
- mkdir ./pylint
- poetry run pylint pipeline --output-format=text | 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/
unit_test:
stage: Test
tags:
- csiro-swarm
script:
- echo $CI_CKAN_KEY > ckan_access_key.txt
- poetry run python -m pytest --cov=pipeline | perl -pe 's/\e\[?.*?[\@-~]//g'