Add test for two worded commands (ie. "tagtypes clear")
[python-musicpd.git] / .gitlab-ci.yml
1 image: python:latest
2
3 before_script:
4   - python -V      # Print out python version for debugging
5
6 stages:
7   - test
8   - build
9
10 .test:
11   stage: test
12   script:
13   - pip install pytest-cov
14   - py.test -q --cov=musicpd test.py
15   only:
16     - pushes
17
18 test-py3.9:
19   extends: ".test"
20   image: "python:3.9"
21   coverage: '/musicpd.py\s+\d+\s+\d+\s+(\d+)%/'
22
23 test-py3.8:
24   extends: ".test"
25   image: "python:3.8"
26
27 test-py3.7:
28   extends: ".test"
29   image: "python:3.7"
30
31
32 build:
33   stage: build
34   script:
35   # packaging test
36   - python setup.py bdist_wheel sdist
37   - pip install dist/*.whl
38   - pip install twine
39   - twine check dist/*
40   artifacts:
41     expire_in: 1 week
42     paths:
43     - dist/*.whl
44     - dist/*.tar.gz
45     - dist/*.zip
46   only:
47     - pushes
48
49 tag_release:
50   stage: build
51   script:
52   - python setup.py bdist_wheel sdist
53   artifacts:
54     paths:
55     - dist/*.whl
56     - dist/*.tar.gz
57     - dist/*.zip
58     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
59   only:
60     - tags
61
62 pages:
63   stage: build
64   script:
65   - pip install sphinx sphinx_rtd_theme
66   - sphinx-build -d ./build/doctrees doc/source -b html ./public -D html_theme=sphinx_rtd_theme
67   artifacts:
68     paths:
69     - public
70   only:
71   - master