# Painless deployment with GitLab CI.
# Visit the docs at https://docs.gitlab.com/ce/ci/

image: painless/tox

stages:
- check
- test
- deploy

.check:
  stage: check
  script: tox
  needs: []
  only:
  - merge_requests
  - main

.test:
  stage: test
  script: tox
  needs: []
  only:
  - merge_requests
  - main
  artifacts:
    reports:
      junit: tests/*-report.xml

.cookiecutter:
  stage: deploy
  before_script:
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p -m 700 ~/.ssh && echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
  - git config --global user.name "Cookiecutter"
  - git config --global user.email "cookiecutter@painless.software"
  only:
  - main

checks:
  extends: .check
  parallel:
    matrix:
    - TOXENV:
      - flake8
      - isort
      - pylint

tests:
  extends: .test
  parallel:
    matrix:
    - TOXENV:
      - py38
      - py39
      - pypy3

behave:
  extends: .test
  variables:
    TOXENV: behave

example-django:
  extends: .cookiecutter
  script: tests/field/example-django.sh

example-springboot:
  extends: .cookiecutter
  script: tests/field/example-springboot.sh

# Painless deployment with GitLab CI.
# Visit the docs at https://docs.gitlab.com/ce/ci/

image: painless/tox

stages:
- check
- test
- deploy

.tox:
  script: tox
  needs: []
  only:
  - merge_requests
  - main

.cookiecutter:
  stage: deploy
  before_script:
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p -m 700 ~/.ssh && echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
  - git config --global user.name "Cookiecutter"
  - git config --global user.email "cookiecutter@painless.software"
  only:
  - main

checks:
  extends: .tox
  stage: check
  parallel:
    matrix:
    - TOXENV:
      - flake8
      - isort
      - pylint

tests:
  extends: .tox
  stage: test
  parallel:
    matrix:
    - TOXENV:
      - py38
      - py39
      - pypy3
  artifacts:
    reports:
      junit: tests/*-report.xml

behave:
  extends: .tox
  stage: test
  variables:
    TOXENV: behave
  artifacts:
    reports:
      junit: tests/TESTS-features.*.xml

example-django:
  extends: .cookiecutter
  script: tests/field/example-django.sh

example-springboot:
  extends: .cookiecutter
  script: tests/field/example-springboot.sh

Make Behave job evaluate test reports (GitLab)
Make Behave job evaluate test reports (GitLab)
