<commit_before>stages:
    - test
    - docker-dev

variables:
    DOCKER_HUB_USERNAME: ""
    DOCKER_HUB_PASSWORD: ""

.docker:
    variables:
        DOCKER_IMAGE:
        DOCKER_FILE:
    image: docker:dind
    script:
        - docker build -t $DOCKER_IMAGE -f $DOCKER_FILE .
        - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
        - docker push inty/opmuse-dev
    only:
        - /^develop$/

pycodestyle:
    stage: test
    image: inty/opmuse-test
    script:
        - pip3 install -r dev-requirements.txt
        - pycodestyle --ignore=E501,W504,E722,E261 opmuse
    only:
        - branches

pytest:
    stage: test
    image: inty/opmuse-test
    script:
        - pip3 install -r requirements.txt -r dev-requirements.txt
        - yarn
        - cp config/opmuse.dist.ini config/opmuse.ini
        - yarn build:dev
        - pytest -o log_cli=true --verbose opmuse/test
    only:
        - branches

docker-dev:
    extends: .docker
    stage: docker-dev
    variables:
        DOCKER_IMAGE: inty/opmuse-dev<commit_msg>Run docker:dind as service and use to build docker image<commit_after>stages:
    - test
    - docker-dev

variables:
    DOCKER_HUB_USERNAME: ""
    DOCKER_HUB_PASSWORD: ""

.docker:
    variables:
        DOCKER_IMAGE:
        DOCKER_FILE:
        DOCKER_HOST: tcp://docker:2375
    image: docker:stable
    services:
        - docker:dind
    before_script:
        - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
    script:
        - docker build -t $DOCKER_IMAGE -f $DOCKER_FILE .
        - docker push inty/opmuse-dev
    only:
        - /^develop$/

pycodestyle:
    stage: test
    image: inty/opmuse-test
    script:
        - pip3 install -r dev-requirements.txt
        - pycodestyle --ignore=E501,W504,E722,E261 opmuse
    only:
        - branches

pytest:
    stage: test
    image: inty/opmuse-test
    script:
        - pip3 install -r requirements.txt -r dev-requirements.txt
        - yarn
        - cp config/opmuse.dist.ini config/opmuse.ini
        - yarn build:dev
        - pytest -o log_cli=true --verbose opmuse/test
    only:
        - branches

docker-dev:
    extends: .docker
    stage: docker-dev
    variables:
        DOCKER_IMAGE: inty/opmuse-dev
{'fraction_non_alphanumeric': 0.09337483325922633, 'fraction_numerical': 0.014228546020453535, 'mean_word_length': 1.9644268774703557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6762795', 'n_tokens_mistral': 843, 'n_tokens_neox': 802, 'n_words': 169}