Skip to content

Commit 6c3c5d3

Browse files
committed
Add lint, format and tests
Signed-off-by: Federico Busetti <[email protected]>
1 parent 3230818 commit 6c3c5d3

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.gitlab_ci/_templates.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,18 @@ variables:
3636
script:
3737
- make typing
3838

39+
.python-lint:
40+
image: $DOCKER_IMAGE_FULL_TAG
41+
script:
42+
- make lint
43+
44+
.python-format:
45+
image: $DOCKER_IMAGE_FULL_TAG
46+
script:
47+
- make format
48+
49+
.python-tests:
50+
image: $DOCKER_IMAGE_FULL_TAG
51+
script:
52+
- make ci-coverage
53+

.gitlab_ci/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,36 @@ typing:
99
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
1010
extends:
1111
- .python-typing
12+
13+
lint:
14+
stage: test
15+
variables:
16+
DOCKER_IMAGE_TAG_PREFIX: "test-"
17+
rules:
18+
# We run the pipeline only on merge requests or the `main` branch
19+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
20+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
21+
extends:
22+
- .python-lint
23+
24+
format:
25+
stage: test
26+
variables:
27+
DOCKER_IMAGE_TAG_PREFIX: "test-"
28+
rules:
29+
# We run the pipeline only on merge requests or the `main` branch
30+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
31+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
32+
extends:
33+
- .python-format
34+
35+
tests:
36+
stage: test
37+
variables:
38+
DOCKER_IMAGE_TAG_PREFIX: "test-"
39+
rules:
40+
# We run the pipeline only on merge requests or the `main` branch
41+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
42+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
43+
extends:
44+
- .python-tests

0 commit comments

Comments
 (0)