| stages: |
| - test |
| - build |
| |
| default: |
| image: python:3.12-bookworm |
| |
| variables: |
| PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" |
| |
| cache: |
| paths: |
| - .cache/pip |
| - venv/ |
| |
| before_script: |
| - perl -v |
| - python -m venv venv |
| - source venv/bin/activate |
| - export PYTHONPATH=PYTHONPATH:. |
| - venv/bin/pip install --upgrade pip |
| - pip install -r requirements.txt |
| - python -m spacy download de_core_news_lg |
| - apt update -y |
| - apt-get install -y cpanminus git |
| - cpanm https://github.com/KorAP/KorAP-XML-CoNLL-U.git |
| |
| test-job: |
| stage: test |
| artifacts: |
| paths: |
| - rei.spacy.zip |
| - rei.spacy.conllu |
| script: |
| - mkdir logs |
| - korapxml2conllu rei.zip | python ./systems/parse_spacy_pipe.py | tee rei.spacy.conllu | conllu2korapxml > rei.spacy.zip |
| - (! grep -E '^0' ./rei.spacy.conllu) |
| |
| # Build Docker image with morphological features and dependency parsing |
| build-docker: |
| stage: build |
| image: docker:24.0.5 |
| services: |
| - docker:24.0.5-dind |
| variables: |
| DOCKER_TLS_CERTDIR: "/certs" |
| before_script: |
| - docker info |
| # Determine image tag based on git ref |
| - | |
| if [ -n "$CI_COMMIT_TAG" ]; then |
| export IMAGE_TAG="$CI_COMMIT_TAG" |
| export IMAGE_NAME="conllu2spacy-$CI_COMMIT_TAG" |
| else |
| export IMAGE_TAG="$CI_COMMIT_SHORT_SHA" |
| export IMAGE_NAME="conllu2spacy-$CI_COMMIT_SHORT_SHA" |
| fi |
| - echo "Building image with tag $IMAGE_TAG" |
| - echo "Image name will be $IMAGE_NAME" |
| script: |
| - docker build -t korap/conllu2spacy:$IMAGE_TAG . |
| - docker save korap/conllu2spacy:$IMAGE_TAG | xz > $IMAGE_NAME.tar.xz |
| - ls -lh $IMAGE_NAME.tar.xz |
| artifacts: |
| paths: |
| - "*.tar.xz" |
| expire_in: 1 week |
| name: "docker-image-$IMAGE_TAG" |
| rules: |
| - if: $CI_COMMIT_TAG |
| when: always |
| - when: manual |
| allow_failure: true |