-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
75 lines (58 loc) · 2.06 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
75 lines (58 loc) · 2.06 KB
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
69
70
71
72
73
74
75
# the python images contain too old PyPy version in their repos
# the ubuntu:latest now (May, 2018) comes with python3.6,
# so specify a little outdated Ubuntu version
image: ubuntu:16.04
before_script:
- apt-get update -qq
- apt-get install -y -qq git # for .fix.sh script
- apt-get install -y -qq python-pip python3-pip pypy-dev
# update pip to correctly do `pip show -f`
- pip install --upgrade pip==9.0.3 # pip 10 is broken, https://github.com/pypa/pip/issues/5240
# update setuptools because old version (<24.3) has bug with hard links
# https://github.com/pypa/setuptools/blob/master/CHANGES.rst#v2430
- pip install -U setuptools
# install PyPy3
- mkdir -p build/
- apt-get install -y -qq wget bzip2
- wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.10.1-linux64.tar.bz2 -qO- | tar -xj -C build/
- ln -sf $(pwd)/build/pypy3*/bin/pypy3 /usr/bin/
- apt-get install -y -qq libexpat-dev libffi6
- python -V # Print out python versions for debugging
- python3 -V
- pypy -V
- pypy3 -V
variables:
NAME: pynogram
# https://stackoverflow.com/a/35101311/1177288
PYTHONIOENCODING: utf-8
test:
script:
- pip install tox
- tox
coverage: '/^TOTAL.*\s+(\d+\%)$/'
run:
script:
- python setup.py sdist bdist_wheel --universal
# docs and LICENSE should be in sources
- tar -tf dist/*.tar.gz | grep -v "/$NAME" | grep '/LICENSE'
- tar -tf dist/*.tar.gz | grep -v "/$NAME" | grep '/docs/.\+md'
# to install and run:
- pip install -U dist/*.whl
- time $NAME -b winter -v
- time $NAME --pbn 4089 --draw-final -vv
# only two files should left
- pip show -f $NAME | grep '^ ' | grep -v " $NAME[-/]" |
wc -l | exit $(awk '{print $1-2}')
artifacts:
paths:
- dist/*.whl
quality:
script:
- pip install tox
- tox -e lint -- $NAME --output-format=text | tee pylint.log || true
# fail if pylint gets score < 9.5
- grep -oP 'has been rated at \K([^/]+)' pylint.log |
python -c 'import sys; a=int((10-float(sys.stdin.read()))*100); sys.exit(a if a>50 else 0)'
artifacts:
paths:
- pylint.log