Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 8.06 KiB
image: python:3.6

include:
  - template: Security/License-Scanning.gitlab-ci.yml

variables:
  POSTGRES_DB: smash
  POSTGRES_USER: runner
  POSTGRES_PASSWORD: password


.test_template: &test_definition
  stage: test
  before_script:
    - apt-get update && apt-get install -y --allow-unauthenticated libsasl2-dev libssl-dev locales locales-all
    - pip install -r requirements.txt --default-timeout=180 -i https://pypi.lcsb.uni.lu/simple/
    - pip install -r requirements-dev.txt --default-timeout=180 -i https://pypi.lcsb.uni.lu/simple/

test_postgres:
    <<: *test_definition
    services:
         - postgres:latest
    script:
         - cp "local_settings_ci.py" "smash/smash/local_settings.py"
         - cd smash
         - python manage.py makemigrations web && python manage.py migrate
         - coverage run --source web manage.py test -v3
         - coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"

test_sqlite:
    <<: *test_definition
    script:
         - cp "local_settings_ci_sqlite.py" "smash/smash/local_settings.py"
         - cd smash
         - python manage.py makemigrations web && python manage.py migrate
         - coverage run --source web manage.py test -v3
         - coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"

test_python_3.7:
    <<: *test_definition
    image: python:3.7
    script:
         - cp "local_settings_ci_sqlite.py" "smash/smash/local_settings.py"
         - cd smash
         - python manage.py makemigrations web && python manage.py migrate
         - coverage run --source web manage.py test -v3
         - coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"

test_python_3.8:
    <<: *test_definition
    image: python:3.8
    script:
         - cp "local_settings_ci_sqlite.py" "smash/smash/local_settings.py"
         - cd smash
         - python manage.py makemigrations web && python manage.py migrate
         - coverage run --source web manage.py test -v3
         - coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"

test_python_latest:
    <<: *test_definition
    image: python:latest
    script:
         - cp "local_settings_ci_sqlite.py" "smash/smash/local_settings.py"
         - cd smash
         - python manage.py makemigrations web && python manage.py migrate
         - coverage run --source web manage.py test -v3
         - coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"

test_create_dummy_script:
    <<: *test_definition