Skip to content

Commit c5e0495

Browse files
authored
Merge pull request #723 from camptocamp/14-fix-test-with-github-action
[14.0][FIX] Enable tests to be run with Github actions
2 parents 1f26cfa + 55c930a commit c5e0495

File tree

4 files changed

+85
-53
lines changed

4 files changed

+85
-53
lines changed

.copier-answers.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.21.1
2+
_commit: v1.22
33
_src_path: gh:oca/oca-addons-repo-template
4-
ci: Travis
4+
ci: GitHub
55
convert_readme_fragments_to_markdown: false
6-
dependency_installation_mode: PIP
76
generate_requirements_txt: true
7+
github_check_license: true
8+
github_ci_extra_env: {}
9+
github_enable_codecov: true
10+
github_enable_makepot: true
811
github_enable_stale_action: true
9-
include_wkhtmltopdf: false
12+
github_enforce_dev_status_compatibility: true
13+
include_wkhtmltopdf: true
1014
odoo_test_flavor: Both
1115
odoo_version: 14.0
1216
org_name: Odoo Community Association (OCA)
1317
org_slug: OCA
1418
rebel_module_groups: []
15-
repo_description: 'TODO: add repo description.'
16-
repo_name: l10n-switzerland
19+
repo_description: Swiss Localization Modules
20+
repo_name: Swiss Localization
1721
repo_slug: l10n-switzerland
1822
repo_website: https://github.com/OCA/l10n-switzerland
19-
travis_apt_packages: []
20-
travis_apt_sources: []
2123
use_pyproject_toml: false
2224
use_ruff: false
2325

.github/workflows/test.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "14.0*"
7+
push:
8+
branches:
9+
- "14.0"
10+
- "14.0-ocabot-*"
11+
12+
jobs:
13+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v3
18+
- run: |
19+
for reqfile in requirements.txt test-requirements.txt ; do
20+
if [ -f ${reqfile} ] ; then
21+
result=0
22+
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
23+
grep "^[^#].*/" ${reqfile} || result=$?
24+
if [ $result -eq 0 ] ; then
25+
echo "Unreleased dependencies found in ${reqfile}."
26+
exit 1
27+
fi
28+
fi
29+
done
30+
test:
31+
runs-on: ubuntu-22.04
32+
container: ${{ matrix.container }}
33+
name: ${{ matrix.name }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
39+
name: test with Odoo
40+
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
41+
name: test with OCB
42+
makepot: "true"
43+
services:
44+
postgres:
45+
image: postgres:9.6
46+
env:
47+
POSTGRES_USER: odoo
48+
POSTGRES_PASSWORD: odoo
49+
POSTGRES_DB: odoo
50+
ports:
51+
- 5432:5432
52+
steps:
53+
- uses: actions/checkout@v3
54+
with:
55+
persist-credentials: false
56+
- name: Install addons and dependencies
57+
run: oca_install_addons
58+
- name: Check licenses
59+
run: manifestoo -d . check-licenses
60+
- name: Check development status
61+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
62+
- name: Initialize test db
63+
run: oca_init_test_database
64+
- name: Run tests
65+
run: oca_run_tests
66+
- uses: codecov/codecov-action@v4
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
- name: Update .pot files
70+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
71+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}

.travis.yml

-42
This file was deleted.

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11

22
[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&target_branch=14.0)
3-
[![Build Status](https://travis-ci.com/OCA/l10n-switzerland.svg?branch=14.0)](https://travis-ci.com/OCA/l10n-switzerland)
3+
[![Pre-commit Status](https://github.com/OCA/l10n-switzerland/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/l10n-switzerland/actions/workflows/pre-commit.yml?query=branch%3A14.0)
4+
[![Build Status](https://github.com/OCA/l10n-switzerland/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/l10n-switzerland/actions/workflows/test.yml?query=branch%3A14.0)
45
[![codecov](https://codecov.io/gh/OCA/l10n-switzerland/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n-switzerland)
56
[![Translation Status](https://translation.odoo-community.org/widgets/l10n-switzerland-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/l10n-switzerland-14-0/?utm_source=widget)
67

78
<!-- /!\ do not modify above this line -->
89

9-
# l10n-switzerland
10+
# Swiss Localization
1011

11-
TODO: add repo description.
12+
Swiss Localization Modules
1213

1314
<!-- /!\ do not modify below this line -->
1415

0 commit comments

Comments
 (0)