-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
68 lines (53 loc) · 1.1 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
image: felipeam86/rrasql:0.10.0
stages:
- build
- test
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.pip
cache:
paths:
- .pip
.restrictions:
only:
- tags
- web
- merge_requests
compile_requirements:
extends: .restrictions
cache: {}
stage: build
script:
- poetry export --without-hashes --dev -f requirements.txt -o requirements.txt
artifacts:
name: requirements.txt
expose_as: requirements
paths:
- requirements.txt
expire_in: never
tests:
extends: .restrictions
stage: test
needs: ["compile_requirements"]
before_script:
- pip install -r requirements.txt
script:
- py.test --cov-report term-missing --cov=cachesql tests/
- coverage xml -o cobertura-coverage.xml
artifacts:
reports:
cobertura: cobertura-coverage.xml
black:
extends: .restrictions
cache: {}
stage: test
needs: []
script:
- black --diff --check .
isort:
extends: .restrictions
stage: test
needs: ["compile_requirements"]
before_script:
- pip install -r requirements.txt
script:
- isort --profile black --diff --check-only .