forked from totaler/mongodb_backend
-
Notifications
You must be signed in to change notification settings - Fork 4
114 lines (99 loc) · 3.63 KB
/
mongo3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Mongodb Backend Tests (mongo3)
on:
pull_request:
types: [ labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.label.name || github.ref }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-tests-3:
if: github.event_name == 'pull_request' && github.event.label.name == 'to be merged'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "2.7", "3.11" ]
erp-module: [ "mongodb_backend" ]
services:
postgres:
image: timescale/timescaledb-ha:pg15-ts2.11-all
env:
POSTGRES_USER: erp
POSTGRES_PASSWORD: erp
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 127.0.0.1:5432:5432
redis:
image: redis:5.0
ports:
- 127.0.0.1:6379:6379
mongo:
image: mongo:3.0
ports:
- 127.0.0.1:27017:27017
steps:
- name: Checkout code (mongodb_backend)
uses: actions/checkout@v4
with:
path: src/mongodb_backend
- name: Checkout code (oorq)
uses: actions/checkout@v4
with:
path: src/oorq
repository: gisce/oorq
token: ${{ secrets.RO_GITHUB_ACTIONS_REPOS }}
- name: Checkout code (ERP)
uses: actions/checkout@v4
with:
path: src/erp
repository: gisce/erp
token: ${{ secrets.RO_GITHUB_ACTIONS_REPOS }}
- name: Set up Python 3
if: matrix.python-version != '2.7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python 2
if: matrix.python-version == '2.7'
run: |
sudo apt update
sudo apt install python2 python2-dev python-pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
printf '1\n' | sudo update-alternatives --config python
cd /usr/bin
sudo ln -s /usr/bin/pip2 ./pip
- name: Install Requirements
run: |
pip install -r src/erp/requirements.txt
pip install -r src/erp/requirements-dev.txt
pip install -r src/erp/server/bin/addons/base/requirements.txt
pip install pymongo==3.13.0
pip install destral
- name: Link addons
run: |
cd src/erp
python tools/link_addons.py
- name: Run tests
env:
OPENERP_SECRET: shhhhhhhht
OPENERP_REDIS_URL: redis://localhost:6379/0
OPENERP_ROOT_PATH: ${{ github.workspace }}/src/erp/server/bin
OPENERP_ADDONS_PATH: ${{ github.workspace }}/src/erp/server/bin/addons
PYTHONPATH: ${{ github.workspace }}/src/erp/server/bin:${{ github.workspace }}/src/erp/server/bin/addons:${{ github.workspace }}/src/erp/server/sitecustomize
OPENERP_DB_USER: erp
OPENERP_DB_PASSWORD: erp
OPENERP_DB_HOST: localhost
run: |
destral --report-coverage --enable-coverage --report-junitxml ${{ github.workspace }}/report_tests -m ${{ matrix.erp-module }}
- name: Publish tests Results Mongo
if: (success() || failure())
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "report_tests/*.xml"
check_name: "TestsResults_mongo3${{ matrix.python-version }}_${{ matrix.erp-module }}"
comment_title: "Python Mongo 3 ${{ matrix.python-version }} Tests for ${{ matrix.erp-module }}"