-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
55 lines (50 loc) · 1.45 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
# Chronologically specify the pipeline stages to run
stages:
- lint
- test
# Common settings for linters to avoid code repetition
# Needs can be used to specify dependencies
# Allow failure is whether the pipeline succeeds on failure or not
.lint-default: &lint-default
stage: lint
needs: []
services: []
allow_failure: false
Lint shell scripts:
<<: *lint-default
image: koalaman/shellcheck-alpine:latest
script:
- printf 'Running shellcheck:'
- printf '%s\n' 'https://github.com/koalaman/shellcheck/wiki/Checks'
- shellcheck --exclude SC1071 bin/*
# Shellcheck the extension-less scripts in bin/
#after_script:
# - fd --extension sh --exclude bin --exec shellcheck
# shellcheck sh files with extensions everywhere else
# Keep the python version in sync with what's in production
# Consider using black instead?
# It's split into multiple script blocks as otherwise the pipeline succeeds even if the first command fails
Lint python scripts:
<<: *lint-default
image: python:3.8
before_script:
- pip install flake8
- pip install black
- pip install pydocstyle
script:
- flake8 --ignore=E203,W503 .
- black --check --diff .
- grep -rl python3 bin/| xargs flake8
- pydocstyle os2borgerpc
.test-default: &test-default
stage: test
needs: []
dependencies: []
Unittest:
<<: *test-default
image: python:3.8
before_script:
- pip install tox
script:
- tox
coverage: '/TOTAL.*\s+(\d+%)$/'