Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template: ci: run license and dev status checks in separate jobs #85

Merged
merged 3 commits into from
Jul 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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