Skip to content

ci

ci #1610

Workflow file for this run

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' }}