Newer
Older
pre-commit:
stage: lint
image: adarnimrod/ci-images:pre-commit
variables: &variables
XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
PIPENV_VENV_IN_PROJECT: "1"
LANG: C.UTF-8
before_script:
- apt-get update
- apt-get install -y libdbus-1-dev
- pipenv install --dev && rm pyproject.toml
script:
- pipenv run lint
cache: &cache
key: "$CI_JOB_NAME"
paths:
- .cache/
- .venv/
test:
stage: test
image: $project:$version-slim
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
69
- apt-get update
- >-
apt-get install -y
bats
build-essential
git
libdbus-1-dev
libffi-dev
libglib2.0-dev
libssl-dev
- |-
if [ "$project" = 'pypy' ]
then
ln -sf /opt/pypy/bin/pypy "/usr/local/bin/python$version"
fi
- pip install pipenv
- pipenv install --dev --python=$version
script:
- pipenv run bats
- pipenv run check
- pipenv run doctest
- pipenv run build
variables:
<<: *variables
PIPENV_SKIP_LOCK: 1
cache: *cache
parallel:
matrix:
- project: python
version:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- project: pypy
version:
- "2.7"
- "3.6"
- "3.7"
upload:
stage: release
image: python:3.6
before_script: *before_script
script:
- mv pypirc $HOME/.pypirc
- pipenv run build
- pipenv run upload
variables: *variables
cache: *cache
rules:
- if: $CI_COMMIT_TAG
artifacts:
paths:
- dist/*.whl
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo GitLab release
rules:
- if: $CI_COMMIT_TAG
release:
name: Release $CI_COMMIT_TAG
tag_name: $CI_COMMIT_TAG
ref: $CI_COMMIT_TAG
description: GitLab release $CI_COMMIT_TAG