From 460f297cedc6143c737708b70d199d9edc5f31a5 Mon Sep 17 00:00:00 2001 From: Wout De Nolf <wout.de_nolf@esrf.fr> Date: Thu, 3 Nov 2022 09:37:10 +0100 Subject: [PATCH 1/3] init/cleanup for linux and windows --- .gitlab-ci-template.yml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index 08b0ca5..97e3255 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -8,21 +8,27 @@ stages: ### Jobs templates ### .scripts: - prepare_python: + init_linux: - cat /etc/os-release - - python --version - - python -m pip install --upgrade pip setuptools - init_python_win: + cleanup_linux: + - echo + init_win: - SET "PATH=C:\\python\\%PYTHON_VER%;C:\\python\\%PYTHON_VER%\\Scripts;%PATH%" - python -m venv --clear build_venv - call "build_venv\\Scripts\\activate.bat" - cleanup_python_win: + cleanup_win: - rmdir build_venv /s /q + init_python: + - python --version + - python -m pip install --upgrade pip setuptools + - python -m pip list install_sdist: + - echo "Not permitted: ls -Rl sdist" - | for filename in sdist/*.tar.gz; do python -m pip install --pre $filename[test] done + - python -m pip list install_sdist_win: - dir sdist - | @@ -30,6 +36,7 @@ stages: echo %%F python -m pip install --pre %%F[test] ) + - python -m pip list .base: only: @@ -46,9 +53,10 @@ stages: - linux image: docker-registry.esrf.fr/dau/ewoks:python_3.7 before_script: - - !reference [.scripts, prepare_python] + - !reference [.scripts, init_linux] + - !reference [.scripts, init_python] after_script: - - echo + - !reference [.scripts, cleanup_linux] .base-win: # Windows, Python 3.7 extends: .base @@ -57,10 +65,10 @@ stages: variables: PYTHON_VER: "3.7" before_script: - - !reference [.scripts, init_python_win] - - !reference [.scripts, prepare_python] + - !reference [.scripts, init_win] + - !reference [.scripts, init_python] after_script: - - !reference [.scripts, cleanup_python_win] + - !reference [.scripts, cleanup_win] .style: # base job for style stage stage: style @@ -71,9 +79,11 @@ stages: extends: .base-lin before_script: - !reference [.base-lin, before_script] - - python -m pip install pytest-cov + - python -m pip install pytest- + - python -m pip list script: - python -m pip install --pre .[test] + - python -m pip list - python -m pytest --cov=./ -v . coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' @@ -82,6 +92,7 @@ stages: extends: .base-win script: - python -m pip install --pre .[test] + - python -m pip list - python -m pytest -v . .build: # base job for build stage (Linux) @@ -96,6 +107,8 @@ stages: script: - python setup.py sdist - mv dist sdist + after_script: + - echo "Not permitted: ls -Rl sdist" artifacts: paths: - sdist/ @@ -145,6 +158,7 @@ flake8: extends: .style before_script: - python -m pip install flake8 + - python -m pip list script: - flake8 @@ -152,6 +166,7 @@ black: extends: .style before_script: - python -m pip install black + - python -m pip list script: - LC_ALL=C.UTF-8 black --check --safe . @@ -161,6 +176,7 @@ black: extends: .style before_script: - python -m pip install flake8_nb + - python -m pip list script: - flake8_nb @@ -169,6 +185,7 @@ black: image: docker-registry.esrf.fr/dau/ewoks:python_3.8_doc # pandoc script: - python -m pip install .[doc] + - python -m pip list - python setup.py build_sphinx - mv build/sphinx/html html after_script: -- GitLab From d4711008343dd657a291426b148a19311e3163d3 Mon Sep 17 00:00:00 2001 From: Wout De Nolf <wout.de_nolf@esrf.fr> Date: Thu, 3 Nov 2022 09:39:58 +0100 Subject: [PATCH 2/3] fixup --- .gitlab-ci-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index 97e3255..8144b4d 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -79,7 +79,7 @@ stages: extends: .base-lin before_script: - !reference [.base-lin, before_script] - - python -m pip install pytest- + - python -m pip install pytest-cov - python -m pip list script: - python -m pip install --pre .[test] -- GitLab From 4d0dcea1f42f25ada40318795684a7e6edcca378 Mon Sep 17 00:00:00 2001 From: Wout De Nolf <wout.de_nolf@esrf.fr> Date: Thu, 3 Nov 2022 09:42:04 +0100 Subject: [PATCH 3/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6df48a2..2da46ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,3 +5,8 @@ test-3.7: extends: .test-3.7 script: - pip install -r requirements.txt + +test-3.7-win: + extends: .test-3.7-win + script: + - pip install -r requirements.txt -- GitLab