From 90be5f36844d8041dc2c34e15610b1cf776e39c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 26 Oct 2021 16:03:38 +0200 Subject: [PATCH 1/3] Pin pre-commit to python 3.9 (for pylint-odoo) --- .github/workflows/pre-commit.yml.jinja | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pre-commit.yml.jinja b/.github/workflows/pre-commit.yml.jinja index 335381c..282a1fa 100644 --- a/.github/workflows/pre-commit.yml.jinja +++ b/.github/workflows/pre-commit.yml.jinja @@ -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/action@v2.0.0 From 9b1679330fa1f85246c594ac1793ec25591feda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 26 Oct 2021 16:09:32 +0200 Subject: [PATCH 2/3] 15.0 and latest goodies from the OCA template --- .github/workflows/test.yml.jinja | 48 ++++++++++++++++++++++++++------ copier.yml | 13 +++++++++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml.jinja b/.github/workflows/test.yml.jinja index 5b5605b..9a4a9ab 100644 --- a/.github/workflows/test.yml.jinja +++ b/.github/workflows/test.yml.jinja @@ -11,6 +11,7 @@ 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", @@ -18,6 +19,7 @@ set IMAGES = { "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", @@ -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 @@ -48,16 +67,27 @@ 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 + - 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 %} diff --git a/copier.yml b/copier.yml index 79346b2..c381334 100644 --- a/copier.yml +++ b/copier.yml @@ -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: @@ -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 From 17e5eb6b2ffb4d35f5862d74a8828c7888971793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 2 Nov 2021 08:29:53 +0100 Subject: [PATCH 3/3] Do not fail test on dev status check --- .github/workflows/test.yml.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml.jinja b/.github/workflows/test.yml.jinja index 9a4a9ab..21ea4bb 100644 --- a/.github/workflows/test.yml.jinja +++ b/.github/workflows/test.yml.jinja @@ -81,6 +81,7 @@ jobs: 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