Skip to content

Commit

Permalink
Merge pull request #61 from acsone/test-github-action
Browse files Browse the repository at this point in the history
Test with GitHub actions
  • Loading branch information
sbidoul authored Oct 14, 2021
2 parents c41aae7 + 17025ec commit 2407f59
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: test Odoo addons

on:
pull_request:
branches:
- "{{ odoo_version }}*"
push:
branches:
- "{{ odoo_version }}*"

{%
set IMAGES = {
"odoo": {
15.0: "ghcr.io/oca/oca-ci/py3.8-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.8-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",
11.0: "ghcr.io/oca/oca-ci/py3.5-ocb11.0:latest",
10.0: "ghcr.io/oca/oca-ci/py2.7-ocb10.0:latest",
}
}
-%}
jobs:
test:
runs-on: ubuntu-latest
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
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
{%- if rebel_module_groups %}
env:
INCLUDE: "{% raw %}${{ matrix.include }}{% endraw %}"
EXCLUDE: "{% raw %}${{ matrix.exclude }}{% endraw %}"
{%- endif %}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- 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
{% 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 == 'OCA' }}
{%- endraw %}
2 changes: 1 addition & 1 deletion src/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
Expand Down

0 comments on commit 2407f59

Please sign in to comment.