Skip to content
Snippets Groups Projects
Commit be3cd5df authored by Philip Elson's avatar Philip Elson :snake:
Browse files

Merge branch 'feature/templates-v2' into 'master'

Migrate CI to Acc-Py CI templates V2

See merge request !95
parents ad6e9c1a 4fda7a98
No related branches found
No related tags found
1 merge request!95Migrate CI to Acc-Py CI templates V2
Pipeline #6358845 passed
include:
- project: 'acc-co/devops/python/acc-py-devtools'
file: 'acc_py_devtools/templates/gitlab-ci/python.yml'
- project: 'acc-co/devops/python/acc-py-gitlab-ci-templates'
file: 'v2/python.gitlab-ci.yml'
variables:
project_name: pyjapc
......@@ -16,111 +16,77 @@ build_docs_on_tag:
extends: .acc_py_build_docs_on_tag
# A push of the source distribution to the acc-py PyPI, only on git tag.
release_sdist:
extends: .acc_py_release_sdist
.base_dev_test:
variables:
env_spec: INSERT_CONDA_REQUIREMENTS
POST_CONDA: ""
PYTEST_ADDOPTS: "-p no:faulthandler"
image: registry.cern.ch/docker.io/continuumio/miniconda3
needs: [] # Don't wait for the wheels to build (we don't need them for dev test)
script:
- conda create -p ./test_env --yes --quiet -c conda-forge pip $env_spec
- source activate ./test_env
- eval ${POST_CONDA}
- mkdir not-the-source-dir && cd not-the-source-dir
- pip install -e ..
- python -c "import pyjapc; print(pyjapc.__version__)"
- pip install stubgenj -e ..[test] types-pytz
- python -m cmmnbuild_dep_manager resolve
- python -m stubgenj cern java.lang java.util org.mockito org.apache
--classpath $(python -m cmmnbuild_dep_manager class_path)
--output-dir $(python -c 'import site; print(site.getsitepackages()[0])')
# NOTE: For successful mypy test, we must use Python >=3.8
- pytest ../pyjapc --mypy
# We only really need a single dev test to ensure that we can actually use
# PyJapc in development mode.
tests_dev_py39_jdk11_jp1p1:
dev_test:
extends:
.base_dev_test
- .acc_py_dev_test
# Needs to run on acc-py for JDK availability
- .acc_py_run_on_acc_py
variables:
env_spec: python=3.9 openjdk=11
POST_CONDA: "python -m pip install jpype1==1.1.* pytest-mypy"
ACC_PY_BASE_IMAGE_NAME: acc-py_cc7_openjdk11_ci
# NOTE: For successful mypy test, Python >=3.9 is required (should be default tag here)
ACC_PY_BASE_IMAGE_TAG: "2021.12"
PYTEST_ADDOPTS: "--mypy"
before_script:
# Only run .acc_py_run_on_acc_py (which is only base before_script), as we've overwritten
# all the logic from .acc_py_dev_test
- !reference [.acc_py_run_on_acc_py, before_script]
- python -m pip install
pytest-mypy
pytest-cov
stubgenj
types-pytz
cmmnbuild-dep-manager
-e "${project_root}"[test]
- python -m cmmnbuild_dep_manager resolve
- python -m stubgenj
cern
java.lang
java.util
org.mockito
org.apache
--classpath $(python -m cmmnbuild_dep_manager class_path)
--output-dir $(python -c 'import site; print(site.getsitepackages()[0])')
.base_wheel_test:
image: registry.cern.ch/docker.io/continuumio/miniconda3
variables:
env_spec: INSERT_CONDA_REQUIREMENTS
POST_CONDA: ""
script:
- conda create -n test_env --yes --quiet -c conda-forge pip $env_spec
- source activate test_env
- eval ${POST_CONDA}
- mkdir not-the-source-dir && cd not-the-source-dir
- pip install "$(ls ../wheelhouse/*.whl)"
# Check that we can actually use PyJapc without the test dependencies.
- python -c "import pyjapc; print(pyjapc.__version__)"
# Now install the test dependencies.
- pip install "$(ls ../wheelhouse/*.whl)[test]"
- pytest --pyargs pyjapc
tests_whl_py38_jdk8_jp1p1:
wheel_test:
extends:
.base_wheel_test
- .acc_py_wheel_test
- .acc_py_run_on_all_currently_supported
variables:
env_spec: python=3.8 openjdk=8
POST_CONDA: "python -m pip install jpype1==1.1.*"
# Note, we do not test against openjdk17 because cmmnbuild does not support it yet
# e.g. OSError: Java version must be either 1.8 or 11, got 17.0.5
# We also no longer test it against JDK8 because - it's unsupported for Python and we've
# stopped shipping container images for it
ACC_PY_BASE_IMAGE_NAME: acc-py_cc7_openjdk11_ci
tests_whl_py38_jdk11_jp1p1:
extends:
.base_wheel_test
variables:
env_spec: python=3.8 openjdk=11
POST_CONDA: "python -m pip install jpype1==1.1.*"
tests_whl_py39_jdk8_jp1p1:
tests_whl_master_jpype:
extends:
.base_wheel_test
variables:
env_spec: python=3.9 openjdk=8
POST_CONDA: "python -m pip install jpype1==1.1.*"
tests_whl_py39_jdk11_jp1p1:
- .acc_py_wheel_test
- .acc_py_run_on_manylinux_py_version
before_script:
# We're running inside manylinux container, which gives us gcc toolchain
# but needs JDK as well to run tests
- yum install -y java-11-openjdk-devel
# Make sure before script is taken from .acc_py_wheel_test (which includes base before_script),
# rather than from .acc_py_run_on_acc_py (which is only base before_script)
- !reference [.acc_py_wheel_test, before_script]
- python -m pip install
git+https://github.com/jpype-project/jpype.git@master
git+https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager.git@master
build_wheel:
extends:
.base_wheel_test
variables:
env_spec: python=3.9 openjdk=11
POST_CONDA: "python -m pip install jpype1==1.1.*"
tests_whl_master_jpype:
extends:
.base_wheel_test
variables:
env_spec: python openjdk=11 gxx_linux-64
POST_CONDA: "python -m pip install git+https://github.com/jpype-project/jpype.git@master git+https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager.git@master"
- .acc_py_build_wheel
- .acc_py_run_on_all_currently_supported
build_wheel_37:
variables:
PY_VERSION: "3.7"
extends:
- .acc_py_build_wheel
build_sdist:
extends: .acc_py_build_sdist
build_wheel_39:
variables:
PY_VERSION: "3.9"
extends:
- .acc_py_build_wheel
release_wheel:
extends: .acc_py_release_wheel
publish:
extends: .acc_py_publish
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment