Skip to content
.gitlab-ci.yml 1.51 KiB
Newer Older
nimrod's avatar
nimrod committed
---
nimrod's avatar
nimrod committed
include:
  - project: shore/ci-templates
    file: templates/pre-commit.yml
  - project: shore/ci-templates
    file: templates/python.yml
  - project: shore/ci-templates
    file: templates/gitlab-release.yml
nimrod's avatar
nimrod committed

test:
  stage: test
  image: $project:$version-slim
nimrod's avatar
nimrod committed
  before_script:
nimrod's avatar
nimrod committed
    - apt-get update
    - >-
      apt-get install -y
      bats
      build-essential
      git
      libdbus-1-dev
      libffi-dev
      libglib2.0-dev
      libssl-dev
nimrod's avatar
nimrod committed
      wget
nimrod's avatar
nimrod committed
    # yamllint disable-line rule:line-length
    - wget https://github.com/cloudbees-oss/juxr/releases/download/0.1.22/juxr-x86_64-unknown-linux-gnu.tar.gz -O - | tar -xzC /usr/local/bin
nimrod's avatar
nimrod committed
    - |-
      if [ "$project" = 'pypy' ]
      then
        ln -sf /opt/pypy/bin/pypy "/usr/local/bin/python$version"
      fi
    - pip install pipenv
    - pipenv install --dev --python=$version
  script:
    - pipenv run bats | tee results.tap
    - pipenv run doctest --junit-xml results/doctest.xml
nimrod's avatar
nimrod committed
  after_script:
    - juxr tap --name bats --output results/ -- cat results.tap
nimrod's avatar
nimrod committed
  variables:
nimrod's avatar
nimrod committed
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
    PIPENV_VENV_IN_PROJECT: "1"
    LANG: C.UTF-8
nimrod's avatar
nimrod committed
    PIPENV_SKIP_LOCK: 1
nimrod's avatar
nimrod committed
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .cache/
      - .venv/
  artifacts:
    reports:
      junit: results/*.xml
nimrod's avatar
nimrod committed
  parallel:
    matrix:
      - project: python
        version:
          - "2.7"
          - "3.6"
          - "3.7"
          - "3.8"
          - "3.9"
      - project: pypy
        version:
          - "2.7"
          - "3.6"
          - "3.7"