Skip to content

Commit

Permalink
Merge pull request #85 from acsone/ci-imp-sbi
Browse files Browse the repository at this point in the history
template: ci: run license and dev status checks in separate jobs
  • Loading branch information
sbidoul authored Jul 28, 2021
2 parents c65ac5d + 7602fca commit fc7bc32
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions acsoo/templates/project/+project.name+/.gitlab-ci.yml.bob
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ before_script:

variables:
PYTHON: {{{ python_version }}}
DB_NAME: "${CI_PROJECT_NAME}-${CI_JOB_ID}"

pre-commit:
stage: test
Expand Down Expand Up @@ -51,16 +50,41 @@ build:
name: "${CI_PROJECT_NAME}-${CI_JOB_ID}-build"
interruptible: true

.test_common: &test_common
stage: test
tags:
- odoo-{{{ odoo.series }}}
image: ghcr.io/acsone/odoo-ci-image:v20210526.0
needs:
- job: build
artifacts: true
interruptible: true

license_check:
<<: *test_common
script:
- virtualenv --python=$PYTHON venv
- source venv/bin/activate
- pip install --no-index --find-links ./release -r requirements.txt
- manifestoo -d odoo/addons check-licenses

dev_status_check:
<<: *test_common
script:
- virtualenv --python=$PYTHON venv
- source venv/bin/activate
- pip install --no-index --find-links ./release -r requirements.txt
- manifestoo -d odoo/addons check-dev-status --default-dev-status=Beta

{{% if odoo.series in ['8.0', '9.0'] %}}
{{% set odoocmd = 'openerp-server' %}}
{{% else %}}
{{% set odoocmd = 'odoo' %}}
{{% endif %}}
test:
stage: test
image: ghcr.io/acsone/odoo-ci-image:v20210526.0
tags:
- odoo-{{{ odoo.series }}}
<<: *test_common
variables:
DB_NAME: "${CI_PROJECT_NAME}-${CI_JOB_ID}"
script:
- pipx install acsoo # for checklog
- start_ssh_agent # for pushing translations
Expand All @@ -69,8 +93,6 @@ test:
# use --no-index so missing dependencies that would not be in *.whl are detected
# install the project in editable mode (-e) so coverage sees it
- venv/bin/pip install --no-index --find-links release -e .
- unbuffer manifestoo -d odoo/addons --addons-path-python=venv/bin/python check-licenses
- unbuffer manifestoo -d odoo/addons --addons-path-python=venv/bin/python check-dev-status --default-dev-status=Beta
- ADDONS_INIT=$(manifestoo -d odoo/addons list-depends --separator=,)
- echo Installing ${ADDONS_INIT}
- unbuffer venv/bin/click-odoo-initdb -c odoo-ci.cfg --new-database ${DB_NAME} --cache-prefix {{{ project.trigram }}} -m ${ADDONS_INIT} | acsoo checklog
Expand All @@ -86,10 +108,6 @@ test:
paths:
- htmlcov/
name: "${CI_PROJECT_NAME}-${CI_JOB_ID}-coverage-html"
needs:
- job: build
artifacts: true
interruptible: true
after_script:
- dropdb --if-exists ${DB_NAME}

Expand Down

0 comments on commit fc7bc32

Please sign in to comment.