50 lines
1.9 KiB
YAML
50 lines
1.9 KiB
YAML
include:
|
|
- project: "Gitlab/gitlab"
|
|
ref: 0.3.0
|
|
file: "/ci-templates/research/python_pkg_venv_test_build_release_gitlab-ci.yml"
|
|
|
|
default:
|
|
image: python:3.10
|
|
|
|
variables:
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
GITLAB_PYPI_URL: https://gitlab.knecon.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi
|
|
PYPI_REGISTRY_RESEARCH: https://gitlab.knecon.com/api/v4/groups/19/-/packages/pypi
|
|
POETRY_SOURCE_REF_RESEARCH: gitlab-research
|
|
PYPI_REGISTRY_RED: https://gitlab.knecon.com/api/v4/groups/12/-/packages/pypi
|
|
POETRY_SOURCE_REF_RED: gitlab-red
|
|
PYPI_REGISTRY_FFORESIGHT: https://gitlab.knecon.com/api/v4/groups/269/-/packages/pypi
|
|
POETRY_SOURCE_REF_FFORESIGHT: gitlab-fforesight
|
|
# POETRY_HOME: /opt/poetry
|
|
|
|
setup-poetry-venv:
|
|
stage: setup
|
|
script:
|
|
- env # check env vars
|
|
# install poetry & return versions
|
|
- pip install --upgrade pip
|
|
- pip -V
|
|
- python -V
|
|
- pip install poetry
|
|
- poetry -V
|
|
# configure poetry
|
|
- poetry config installer.max-workers 10
|
|
- poetry config virtualenvs.in-project true
|
|
- poetry config repositories.${POETRY_SOURCE_REF_RESEARCH} ${PYPI_REGISTRY_RESEARCH}
|
|
- poetry config http-basic.${POETRY_SOURCE_REF_RESEARCH} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
- poetry config repositories.${POETRY_SOURCE_REF_RED} ${PYPI_REGISTRY_RED}
|
|
- poetry config http-basic.${POETRY_SOURCE_REF_RED} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
- poetry config repositories.${POETRY_SOURCE_REF_FFORESIGHT} ${PYPI_REGISTRY_FFORESIGHT}
|
|
- poetry config http-basic.${POETRY_SOURCE_REF_FFORESIGHT} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
# create and activate venv
|
|
- poetry env use $(which python)
|
|
- source .venv/bin/activate
|
|
- python -m ensurepip
|
|
- env # check env vars again
|
|
# install from poetry.lock file
|
|
- poetry install --all-extras -vvv
|
|
|
|
run-tests:
|
|
script:
|
|
- echo "Disabled until we have an automated way to run docker compose before tests."
|