Commit fd0ab5a4 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

Update CI config

parent 6b9c3199
Pipeline #27502 passed with stage
in 22 seconds
stages:
- test
cache:
key: "$CI_PROJECT_NAME"
paths:
- $HOME/.cache/pip
before_script:
- python3.6 -m venv $HOME/tox
- $HOME/tox/bin/pip install tox
py27-django110-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield0'
py27-django110-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield1'
py27-django110-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110-jsonfield2'
# tox location on FU_URZ_CI_SERVER
variables:
TOX: "/opt/venv/python3.6/tox/bin/tox"
LD_LIBRARY_PATH: "/opt/sqlite-compat-django/lib/"
py27-django111-jsonfield0:
variables:
LD_LIBRARY_PATH: ""
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield0'
script: $TOX -e 'py27-django111-jsonfield0'
py27-django111-jsonfield1:
variables:
LD_LIBRARY_PATH: ""
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield1'
script: $TOX -e 'py27-django111-jsonfield1'
py27-django111-jsonfield2:
variables:
LD_LIBRARY_PATH: ""
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111-jsonfield2'
py36-django110-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield0'
py36-django110-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield1'
py36-django110-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110-jsonfield2'
py36-django111-jsonfield0:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield0'
script: $TOX -e 'py27-django111-jsonfield2'
py36-django111-jsonfield1:
variables:
LD_LIBRARY_PATH: ""
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield1'
script: $TOX -e 'py36-django111-jsonfield1'
py36-django111-jsonfield2:
variables:
LD_LIBRARY_PATH: ""
stage: test
script: $TOX -e 'py36-django111-jsonfield2'
py36-django21-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111-jsonfield2'
script: $TOX -e 'py36-django21-jsonfield1'
py36-django20-jsonfield0:
py36-django21-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django20-jsonfield0'
script: $TOX -e 'py36-django21-jsonfield2'
py36-django20-jsonfield1:
py36-django22-jsonfield1:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django20-jsonfield1'
script: $TOX -e 'py36-django22-jsonfield1'
py36-django20-jsonfield2:
py36-django22-jsonfield2:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django20-jsonfield2'
script: $TOX -e 'py36-django22-jsonfield2'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import subprocess
......@@ -7,35 +8,32 @@ Generates a GitLab CI config from the tox.ini so that every
tox environment runs in a seprate GitLab CI job.
"""
YAML_TEMPLATE = """
YAML_TEMPLATE = """\
stages:
- test
cache:
key: "$CI_PROJECT_NAME"
paths:
- $HOME/.cache/pip
before_script:
- python3.6 -m venv $HOME/tox
- $HOME/tox/bin/pip install tox
# tox location on FU_URZ_CI_SERVER
variables:
TOX: "/opt/venv/python3.6/tox/bin/tox"
"""
def get_tox_envs():
p = subprocess.Popen(["tox", "-l"], stdout=subprocess.PIPE)
_stdout, _stderr = p.communicate()
return _stdout.decode("utf-8").splitlines()
def generate_gitlab_ci_yaml():
ci_config = YAML_TEMPLATE
for tox_env in get_tox_envs():
ci_config += "%s:\n" % tox_env
ci_config += " stage: test\n"
ci_config += " script: $HOME/tox/bin/tox -e '%s'\n\n" % tox_env
return ci_config
ci_config = YAML_TEMPLATE
for tox_env in get_tox_envs():
ci_config += "%s:\n" % tox_env
ci_config += " stage: test\n"
ci_config += " script: $TOX -e '%s'\n\n" % tox_env
return ci_config
if __name__ == '__main__':
with open('.gitlab-ci.yml', 'w') as f:
f.write(generate_gitlab_ci_yaml())
if __name__ == '__main__':
with open('.gitlab-ci.yml', 'w') as f:
f.write(generate_gitlab_ci_yaml())
[tox]
envlist = py{27}-django{110,111}-jsonfield{0,1,2},
py{36}-django{110,111,20}-jsonfield{0,1,2},
envlist = py{27}-django{111}-jsonfield{0,1,2},
py{36,37}-django{111,21,22}-jsonfield{1,2},
skip_missing_interpreters = true
[testenv]
commands = {envpython} runtests.py
......@@ -8,9 +9,9 @@ deps =
jsonfield0: jsonfield < 1
jsonfield1: jsonfield >= 1, < 2
jsonfield2: jsonfield >= 2
django110: Django >= 1.10, < 1.11
django111: Django >= 1.11, < 2
django20: Django >= 2, < 2.1
django21: Django==2.1.*
django22: Django==2.2.*
[testenv:py36]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment