Skip to content

Commit

Permalink
[Madoshakalaka#75] add tox job
Browse files Browse the repository at this point in the history
Signed-off-by: Bryant Finney <finneybp@gmail.com>
  • Loading branch information
bryant-finney committed Nov 7, 2021
1 parent e15d454 commit b2c1ba0
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .gitlab/ci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ workflow:
when: never
- when: always

.parallel python versions:
# jobs that extend this one are executed in parallel
parallel:
matrix:
- PY_MAJOR: 3
PY_MINOR: [6, 7, 8]

update python images:
# when the pipeline is executed on a schedule / manually, update the Docker images
# in the project registry
after_script: [docker logout $CI_REGISTRY]

before_script:
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD

extends: [.parallel python versions]

image: docker:20.10
needs: []

parallel:
matrix:
- PY_MAJOR: 3
PY_MINOR: [6, 7, 8]

rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
Expand All @@ -37,3 +43,14 @@ update python images:
stage: build
variables:
DOCKER_IMAGE: python:${PY_MAJOR}.${PY_MINOR}

tox:
# use tox to run the test suite in the python image
before_script: [pip3 install --upgrade tox]
extends: [.parallel python versions]
image: $CI_REGISTRY_IMAGE/python:${PY_MAJOR}.${PY_MINOR}

needs: []
script:
- tox -e py${PY_MAJOR}${PY_MINOR} .
stage: test

0 comments on commit b2c1ba0

Please sign in to comment.