ops: update CI
This commit is contained in:
parent
527a671a75
commit
6a0bbad108
@ -1,49 +1,23 @@
|
||||
# CI for services, check gitlab repo for python package CI
|
||||
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
|
||||
ref: main
|
||||
file: "/ci-templates/research/python_pkg-test-build-release.gitlab-ci.yml"
|
||||
|
||||
# set project variables here
|
||||
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
|
||||
NEXUS_PROJECT_DIR: research # subfolder in Nexus docker-gin where your container will be stored
|
||||
IMAGENAME: $CI_PROJECT_NAME # if the project URL is gitlab.example.com/group-name/project-1, CI_PROJECT_NAME is project-1
|
||||
REPORTS_DIR: reports
|
||||
FF_USE_FASTZIP: "true" # enable fastzip - a faster zip implementation that also supports level configuration.
|
||||
ARTIFACT_COMPRESSION_LEVEL: default # can also be set to fastest, fast, slow and slowest. If just enabling fastzip is not enough try setting this to fastest or fast.
|
||||
CACHE_COMPRESSION_LEVEL: default # same as above, but for caches
|
||||
# TRANSFER_METER_FREQUENCY: 5s # will display transfer progress every 5 seconds for artifacts and remote caches. For debugging purposes.
|
||||
|
||||
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."
|
||||
############
|
||||
# UNIT TESTS
|
||||
unit-tests:
|
||||
variables:
|
||||
###### UPDATE/EDIT ######
|
||||
UNIT_TEST_DIR: "tests/unit_test"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user