Skip to content

Commit

Permalink
[Madoshakalaka#75] use tox on windows jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Bryant Finney <[email protected]>
  • Loading branch information
bryant-finney committed Nov 9, 2021
1 parent f760b92 commit 34df2a2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .gitlab/ci/Install-Pyenv.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -------------------------------------------------------------------------------------
# Summary: Install `pyenv`, populating shell variables needed to run it.
# Created: 2021-11-08 21:16:59
# Author: Bryant Finney (https://bryant-finney.github.io/about)
# -------------------------------------------------------------------------------------
choco install -y pyenv-win

Write-Output '1. add PYENV, PPYENV_HOME, and PYENV_ROOT environment variables'
$env:PYENV = $env:USERPROFILE + '\.pyenv\pyenv-win\'
$env:PYENV_ROOT = $env:USERPROFILE + '\.pyenv\pyenv-win\'
$env:PYENV_HOME = $env:USERPROFILE + '\.pyenv\pyenv-win\'

Write-Output '2. update the PATH variable'
$env:Path = -Join (
$env:USERPROFILE,
'\.pyenv\pyenv-win\bin;',
$env:USERPROFILE,
'\.pyenv\pyenv-win\shims;',
$env:Path
)

pyenv --version
pyenv rehash
30 changes: 18 additions & 12 deletions .gitlab/ci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ 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
Expand All @@ -25,7 +18,10 @@ update python images:
before_script:
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD

extends: [.parallel python versions]
parallel:
matrix:
- PY_MAJOR: 3
PY_MINOR: [6, 7, 8]

image: docker:20.10
needs: []
Expand Down Expand Up @@ -56,17 +52,27 @@ tox:
stage: test

tox:windows:
before_script: [choco install -y pyenv-win]
before_script:
- . .\.gitlab\ci\Install-Pyenv.ps1
- pyenv install $PY_VERSION
- pyenv global $PY_VERSION
- pip install tox
image: null
needs: []

parallel:
matrix:
- { PY_MAJOR: 3, PY_MINOR: 6, PY_PATCH: 8 }
- { PY_MAJOR: 3, PY_MINOR: 7, PY_PATCH: 9 }
- { PY_MAJOR: 3, PY_MINOR: 8, PY_PATCH: 10 }

script:
- pyenv --version
- pyenv rehash
- foreach ($py_version in "3.6.15","3.7.12","3.8.12"){pyenv install $py_version}
- tox -e py${PY_MAJOR}${PY_MINOR} .

stage: test
tags:
- shared-windows
- windows
- windows-1809
variables:
PY_VERSION: ${PY_MAJOR}.${PY_MINOR}.${PY_PATCH}

0 comments on commit 34df2a2

Please sign in to comment.