.gitlab-ci.yml 2.45 KB
Newer Older
1 2 3 4 5 6 7 8
include:
  - project: 'acc-co/devops/python/acc-py-devtools'
    file: 'acc_py_devtools/templates/gitlab-ci/python.yml'

variables:
  project_name: pyjapc


9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# A dev build of the documentation, made available through cern.ch/acc-py.
build_docs:
  extends: .acc_py_build_docs


# A release build of the documentation, made available through cern.ch/acc-py.
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


24 25 26
.base_dev_test:
  variables:
    env_spec: INSERT_CONDA_REQUIREMENTS
27
    POST_CONDA: ""
28 29
  image: continuumio/miniconda3
  script:
30 31
    - conda create -n test_env --yes --quiet -c conda-forge pip $env_spec
    - source activate test_env
32
    - eval ${POST_CONDA}
33

34 35 36 37 38 39
    - mkdir not-the-source-dir && cd not-the-source-dir
    - pip install -e ..
    - python -c "import pyjapc; print(pyjapc.__version__)"
    - pip install -e ..[test]
    - pytest ../pyjapc

40

41 42 43 44 45 46
# We only really need a single dev test to ensure that we can actually use
# PyJapc in development mode.
tests_dev_py36_jdk8_jp06:
  extends:
    .base_dev_test
  variables:
47 48
    env_spec: python=3.6 openjdk=8
    POST_CONDA: "python -m pip install jpype1==1.1.*"
49

50

51
.base_wheel_test:
52
  image: continuumio/miniconda3
53 54
  variables:
    env_spec: INSERT_CONDA_REQUIREMENTS
55
    POST_CONDA: ""
56
  script:
57 58
    - conda create -n test_env --yes --quiet -c conda-forge pip $env_spec
    - source activate test_env
59
    - eval ${POST_CONDA}
60

61
    - mkdir not-the-source-dir && cd not-the-source-dir
62
    - pip install "$(ls ../wheelhouse/*.whl)"
63
    # Check that we can actually use PyJapc without the test dependencies.
64
    - python -c "import pyjapc; print(pyjapc.__version__)"
65 66
    # Now install the test dependencies.
    - pip install "$(ls ../wheelhouse/*.whl)[test]"
67
    - pytest --pyargs pyjapc
68

69

70 71 72 73 74 75 76 77 78 79 80 81 82
tests_whl_py38_jdk8_jp1p1:
  extends:
    .base_wheel_test
  variables:
    env_spec: python=3.8 openjdk=8
    POST_CONDA: "python -m pip install jpype1==1.1.*"

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.*"
83

84 85 86 87
tests_whl_master_jpype:
 extends:
   .base_wheel_test
 variables:
88 89
    env_spec: python openjdk=11 gxx_linux-64
    POST_CONDA: "python -m pip install git+https://github.com/jpype-project/jpype.git@master"
90 91


92 93 94 95
build_wheel:
  extends:
    - .acc_py_build_wheel

96

97 98
release_wheel:
  extends: .acc_py_release_wheel