.gitlab-ci.yml 1008 Bytes
Newer Older
1
2
3
4
5
cache:
  untracked: true
  key: "$CI_BUILD_REF_NAME"
  paths:
    - .venv/
PLian's avatar
PLian committed
6
    - param_runner/lib/spearmint/lib/
7
8

before_script:
9
10
11
  - export PATH=$(pwd)/.venv/bin/:$PATH
  - export LD_LIBRARY_PATH=$(pwd)/.venv/lib/:$LD_LIBRARY_PATH
  - echo $PATH
12

David Trudgian's avatar
David Trudgian committed
13
14
stages:
  - deps
PLian's avatar
PLian committed
15
16
17
  - lint_1
  - lint_2
  - lint_3
David Trudgian's avatar
David Trudgian committed
18
19
20
21
22
23
  - build
  - test

setup-venv:
  stage: deps
  script:
PLian's avatar
PLian committed
24
25
    - sh provision/setup_venv.sh
    - sh param_runner/lib/setup_sp.sh
26
    - pip3 install -r requirements_dev.txt
David Trudgian's avatar
David Trudgian committed
27
28
29
30
31
  artifacts:
    paths:
      - .venv/

flake8:
PLian's avatar
PLian committed
32
  stage: lint_1
David Trudgian's avatar
David Trudgian committed
33
  script:
34
    - flake8 --exclude=*/spearmint/*,*/test/*,*/examples/* param_runner
David Trudgian's avatar
David Trudgian committed
35
36

pydocstyle:
PLian's avatar
PLian committed
37
  stage: lint_2
David Trudgian's avatar
David Trudgian committed
38
  script:
39
    - pydocstyle --match-dir='(?!spearmint).or(?!test).or(?!examples).' param_runner
David Trudgian's avatar
David Trudgian committed
40

David Trudgian's avatar
David Trudgian committed
41
bandit:
PLian's avatar
PLian committed
42
  stage: lint_3
David Trudgian's avatar
David Trudgian committed
43
44
  allow_failure: true
  script:
45
    - bandit -x spearmint,test,examples -r param_runner
David Trudgian's avatar
David Trudgian committed
46
47
48
49
50
51

setup-py:
  stage: build
  dependencies:
    - setup-venv
  script:
PLian's avatar
PLian committed
52
    - pip3 install .
David Trudgian's avatar
David Trudgian committed
53
54

test:
55
  coverage: '/\d+\%\s*$/'
David Trudgian's avatar
David Trudgian committed
56
  script:
57
  - python3 setup.py test