Newer
Older
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
image: python:3.9-slim
# Make pip cache the installed dependencies
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
LINE_LENGTH: 96
SOURCES: building
cache:
paths:
- .cache/pip
- venv/
stages:
- linters
- release
linters:
stage: linters
before_script:
- python3 -V
- pip3 install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip3 install black pylint flake8
script:
- flake8 --max-line-length=$LINE_LENGTH $SOURCES
- black --check --line-length $LINE_LENGTH $SOURCES
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
only:
- tags
script:
- echo "running release_job for $CI_COMMIT_TAG"
release:
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG_MESSAGE'
ref: '$CI_COMMIT_SHA'