Skip to content

Commit

Permalink
Merge pull request #6 from shopinvader/fall-2021-sbi
Browse files Browse the repository at this point in the history
Fall 2021
  • Loading branch information
sbidoul authored Nov 2, 2021
2 parents 48522c0 + 17e5eb6 commit 9cb47b2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
# The pylint-odoo version we use here does not support python 3.10
# https://github.com/OCA/oca-addons-repo-template/issues/80
python-version: "3.9"
- uses: pre-commit/[email protected]
49 changes: 40 additions & 9 deletions .github/workflows/test.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ on:
{%
set IMAGES = {
"odoo": {
"15.0": "ghcr.io/oca/oca-ci/py3.7-odoo15.0:latest",
"14.0": "ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest",
"13.0": "ghcr.io/oca/oca-ci/py3.6-odoo13.0:latest",
"12.0": "ghcr.io/oca/oca-ci/py3.6-odoo12.0:latest",
"11.0": "ghcr.io/oca/oca-ci/py3.5-odoo11.0:latest",
"10.0": "ghcr.io/oca/oca-ci/py2.7-odoo10.0:latest",
},
"ocb": {
"15.0": "ghcr.io/oca/oca-ci/py3.7-ocb15.0:latest",
"14.0": "ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest",
"13.0": "ghcr.io/oca/oca-ci/py3.6-ocb13.0:latest",
"12.0": "ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest",
Expand All @@ -29,14 +31,31 @@ set IMAGES = {
jobs:
test:
runs-on: ubuntu-latest
container: {{ "${{" }} matrix.container {{ "}}" }}
container: {% raw %}${{ matrix.container }}{% endraw %}
strategy:
fail-fast: false
matrix:
{%- if rebel_module_groups %}
include:
{%- for group in rebel_module_groups %}
- container: {{ IMAGES["odoo"][odoo_version] }}
include: "{{ group }}"
makepot: "true"
- container: {{ IMAGES["ocb"][odoo_version] }}
include: "{{ group }}"
{%- endfor %}
- container: {{ IMAGES["odoo"][odoo_version] }}
exclude: "{{ rebel_module_groups|join(',') }}"
makepot: "true"
- container: {{ IMAGES["ocb"][odoo_version] }}
exclude: "{{ rebel_module_groups|join(',') }}"
{%- else %}
{#- If all modules can get along, we test and generate .pot all at once #}
include:
- container: {{ IMAGES["odoo"][odoo_version] }}
makepot: "true"
- container: {{ IMAGES["ocb"][odoo_version] }}
{%- endif %}
services:
postgres:
image: postgres:9.6
Expand All @@ -48,16 +67,28 @@ jobs:
- 5432:5432
env:
PIP_EXTRA_INDEX_URL: "https://wheelhouse.shopinvader.com/simple/"
{%- if rebel_module_groups %}
INCLUDE: "{% raw %}${{ matrix.include }}{% endraw %}"
EXCLUDE: "{% raw %}${{ matrix.exclude }}{% endraw %}"
{%- endif %}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- run: oca_install_addons
- run: oca_init_test_database
- run: oca_run_tests
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
continue-on-error: true
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- run: |
oca_export_and_commit_pot
git fetch --unshallow --all
git push https://x-access-token:{{ "${{" }} secrets.GIT_PUSH_TOKEN {{ "}}" }}@github.com/{{ "${{" }} github.repository {{ "}}" }}
if: {{ "${{" }} matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'shopinvader' && startsWith(github.ref, 'refs/heads/{{ odoo_version }}') {{ "}}" }}
{% raw -%}
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'shopinvader' }}
{%- endraw %}
13 changes: 13 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ odoo_version:
- "12.0"
- "13.0"
- "14.0"
- "15.0"
help: Which Odoo version are we deploying in this branch?

repo_slug:
Expand All @@ -39,6 +40,18 @@ generate_requirements_txt:
Generate requirements.txt from addons manifests and optional overrides in setup.py
files.

rebel_module_groups:
type: yaml
default: []
help: >
Are there in this repo modules that don't get along with their friends? If so, list
them here (YAML format) and they will be tested in separate jobs.
Beware, if rebel modules should stay separated in groups, you should join them with
commas, which could be misinterpreted by YAML.
Example: ["rebel_module_1,rebel_module_2", even_more_rebel_module]
black_version:
default: 19.10b0
type: str
Expand Down

0 comments on commit 9cb47b2

Please sign in to comment.