| 1 | # We use a job template to avoid mindless repetition. All of our jobs |
| 2 | # run 'tox', and we vary which tox environment they run or which |
| 3 | # Python version they use by overriding the 'TOXENV' environment |
| 4 | # variable or the 'image' job parameter. |
| 5 | # |
| 6 | # The name of the template starts with a dot to prevent GitLab from |
| 7 | # running it as an actual job. |
| 8 | .tox: |
| 9 | image: python:latest |
| 10 | before_script: |
| 11 | - pip install tox |
| 12 | script: |
| 13 | - tox |
| 14 | variables: |
| 15 | TOXENV: py |
| 16 | # The environment 'py' uses the version of Python used to invoke tox, |
| 17 | # which allows us to test various Python versions by changing the |
| 18 | # Docker image version in use. |
| 19 | |
| 20 | # the main test suite, for each python version |
| 21 | test: |
| 22 | extends: .tox |
| 23 | # match this list of python versions with the classifiers variable |
| 24 | # in setup.py. see also the list in .gitlab-ci.yml, which is |
| 25 | # specific to the docker container running the tests |
| 26 | parallel: |
| 27 | matrix: |
| 28 | - IMAGE: |
| 29 | - python:3.5 |
| 30 | - python:3.6 |
| 31 | - python:3.7 |
| 32 | - python:3.8 |
| 33 | image: $IMAGE |
| 34 | |
| 35 | flake8: |
| 36 | extends: .tox |
| 37 | variables: |
| 38 | TOXENV: flake8 |
| 39 | |
| 40 | black: |
| 41 | extends: .tox |
| 42 | variables: |
| 43 | TOXENV: black |