-
-
Notifications
You must be signed in to change notification settings - Fork 42
174 lines (171 loc) · 6 KB
/
ci.yaml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: ci
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 4 * * *"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
main:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# odoo/odoo
- python_version: "3.6"
codename: focal
odoo_version: "12.0"
odoo_org_repo: "odoo/odoo"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
image_name: py3.6-odoo12.0
- python_version: "3.6"
codename: focal
odoo_version: "13.0"
odoo_org_repo: "odoo/odoo"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
image_name: py3.6-odoo13.0
- python_version: "3.6"
codename: focal
odoo_version: "14.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.6-odoo14.0
- python_version: "3.8"
codename: focal
odoo_version: "14.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.8-odoo14.0
- python_version: "3.8"
codename: focal
odoo_version: "15.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.8-odoo15.0
- python_version: "3.9"
codename: focal
odoo_version: "15.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.9-odoo15.0
- python_version: "3.10"
codename: jammy
odoo_version: "16.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.10-odoo16.0
- python_version: "3.10"
codename: jammy
odoo_version: "17.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.10-odoo17.0
- python_version: "3.10"
codename: jammy
odoo_version: "18.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.10-odoo18.0
# oca/ocb
- python_version: "3.6"
codename: focal
odoo_version: "12.0"
odoo_org_repo: "oca/ocb"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
image_name: py3.6-ocb12.0
- python_version: "3.6"
codename: focal
odoo_version: "13.0"
odoo_org_repo: "oca/ocb"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
image_name: py3.6-ocb13.0
- python_version: "3.6"
codename: focal
odoo_version: "14.0"
odoo_org_repo: "oca/ocb"
image_name: py3.6-ocb14.0
- python_version: "3.8"
codename: focal
odoo_version: "14.0"
odoo_org_repo: "oca/ocb"
image_name: py3.8-ocb14.0
- python_version: "3.8"
codename: focal
odoo_version: "15.0"
odoo_org_repo: "oca/ocb"
image_name: py3.8-ocb15.0
- python_version: "3.9"
codename: focal
odoo_version: "15.0"
odoo_org_repo: "oca/ocb"
image_name: py3.9-ocb15.0
- python_version: "3.10"
codename: jammy
odoo_version: "16.0"
odoo_org_repo: "oca/ocb"
image_name: py3.10-ocb16.0
- python_version: "3.10"
codename: jammy
odoo_version: "17.0"
odoo_org_repo: "oca/ocb"
image_name: py3.10-ocb17.0
- python_version: "3.10"
codename: jammy
odoo_version: "18.0"
odoo_org_repo: "oca/ocb"
image_name: py3.10-ocb18.0
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v6
with:
build-args: |
codename=${{ matrix.codename }}
python_version=${{ matrix.python_version }}
odoo_version=${{ matrix.odoo_version }}
odoo_org_repo=${{ matrix.odoo_org_repo }}
setuptools_constraint=${{ matrix.setuptools_constraint }}
tags: |
ghcr.io/oca/oca-ci/${{ matrix.image_name }}:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
cache-from: type=registry,ref=ghcr.io/oca/oca-ci/${{ matrix.image_name }}:latest
cache-to: type=local,dest=/tmp/.buildx-cache
load: true
- name: Checkout
uses: actions/checkout@v4
- name: Tests
run: docker run -v ${PWD}/tests:/mnt/tests --network=host -e PGHOST=localhost ghcr.io/oca/oca-ci/${{ matrix.image_name }}:latest /mnt/tests/runtests.sh -v
# Don't bother with Odoo 8 and 9 for now...
if: ${{ matrix.odoo_version != '8.0' && matrix.odoo_version != '9.0' }}
- name: Push image
uses: docker/build-push-action@v6
with:
build-args: |
codename=${{ matrix.codename }}
python_version=${{ matrix.python_version }}
odoo_version=${{ matrix.odoo_version }}
odoo_org_repo=${{ matrix.odoo_org_repo }}
setuptools_constraint=${{ matrix.setuptools_constraint }}
tags: |
ghcr.io/oca/oca-ci/${{ matrix.image_name }}:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=inline
push: true
if: ${{ github.repository_owner == 'OCA' && github.ref == 'refs/heads/master' }}