Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.22 KiB
Newer Older
Vincent Hatakeyama's avatar
Vincent Hatakeyama committed
stages:
- test
- prepare
- main

black:
  stage: test
  image:
    name: houzefaabba/python3-black
    entrypoint: [/bin/busybox]
  script:
  - black --check -l79 .
# TODO move standard configuration to our own image

flake8:
  stage: test
  image:
    name: xcgd/flake8:3
    entrypoint: [/bin/busybox]
  script:
  - flake8

isort:
  stage: test
  image: xcgd/isort:odoo
  script:
  - isort --check-only --diff

get_odoo_scripts:
  stage: prepare
  image:
    name: jamesnetherton/mercurial
    entrypoint: [""]
  artifacts:
    paths:
    - odoo_scripts
  script:
  - hg clone https://orus.io/xcg/odoo_scripts

test:
  stage: main
  image:
    name: registry.xcg.io/odoo/odoo:11.0
    entrypoint: [""]
  services:
  - name: postgres:11-alpine
  variables:
    POSTGRES_DB: test
    POSTGRES_USER: odoo
    POSTGRES_PASSWORD: odoo
    PGPASSFILE: /var/tmp/.pgpass
  script:
    # Fetch odoo_scripts dependencies for do_tests
    - apt-get -q update && DEBIAN_FRONTEND=noninteractive apt-get -q -y install zsh

    # PostgreSQL tweaks.
    - "echo \"postgres:5432:*:odoo:odoo\" > $PGPASSFILE"
    - chmod 0600 $PGPASSFILE
    - chown odoo $PGPASSFILE

    # Run tests.
    - export PGPASSFILE=$PGPASSFILE
    - ./odoo_scripts/do_tests postgres odoo