Skip to content

ci

ci #1141

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: "2.7"
odoo_version: "8.0"
odoo_org_repo: "odoo/odoo"
virtualenv_constraint: "<20.22"
image_name: py2.7-odoo8.0
- python_version: "2.7"
odoo_version: "9.0"
odoo_org_repo: "odoo/odoo"
virtualenv_constraint: "<20.22"
image_name: py2.7-odoo9.0
- python_version: "2.7"
odoo_version: "10.0"
odoo_org_repo: "odoo/odoo"
virtualenv_constraint: "<20.22"
image_name: py2.7-odoo10.0
- python_version: "3.5"
odoo_version: "11.0"
odoo_org_repo: "odoo/odoo"
virtualenv_constraint: "<20.22"
image_name: py3.5-odoo11.0
- python_version: "3.6"
odoo_version: "12.0"
odoo_org_repo: "odoo/odoo"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
virtualenv_constraint: "<20.22"
image_name: py3.6-odoo12.0
- python_version: "3.6"
odoo_version: "13.0"
odoo_org_repo: "odoo/odoo"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
virtualenv_constraint: "<20.22"
image_name: py3.6-odoo13.0
- python_version: "3.6"
odoo_version: "14.0"
odoo_org_repo: "odoo/odoo"
virtualenv_constraint: "<20.22"
image_name: py3.6-odoo14.0
- python_version: "3.8"
odoo_version: "14.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.8-odoo14.0
- python_version: "3.8"
odoo_version: "15.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.8-odoo15.0
- python_version: "3.9"
odoo_version: "15.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.9-odoo15.0
- python_version: "3.10"
odoo_version: "16.0"
odoo_org_repo: "odoo/odoo"
image_name: py3.10-odoo16.0
# oca/ocb
- python_version: "2.7"
odoo_version: "8.0"
odoo_org_repo: "oca/ocb"
virtualenv_constraint: "<20.22"
image_name: py2.7-ocb8.0
- python_version: "2.7"
odoo_version: "9.0"
odoo_org_repo: "oca/ocb"
virtualenv_constraint: "<20.22"
image_name: py2.7-ocb9.0
- python_version: "2.7"
odoo_version: "10.0"
odoo_org_repo: "oca/ocb"
virtualenv_constraint: "<20.22"
image_name: py2.7-ocb10.0
- python_version: "3.5"
odoo_version: "11.0"
odoo_org_repo: "oca/ocb"
virtualenv_constraint: "<20.22"
image_name: py3.5-ocb11.0
- python_version: "3.6"
odoo_version: "12.0"
odoo_org_repo: "oca/ocb"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
virtualenv_constraint: "<20.22"
image_name: py3.6-ocb12.0
- python_version: "3.6"
odoo_version: "13.0"
odoo_org_repo: "oca/ocb"
setuptools_constraint: "<58" # vatnumber needs setuptools with 2to3 support
virtualenv_constraint: "<20.22"
image_name: py3.6-ocb13.0
- python_version: "3.6"
odoo_version: "14.0"
odoo_org_repo: "oca/ocb"
virtualenv_constraint: "<20.22"
image_name: py3.6-ocb14.0
- python_version: "3.8"
odoo_version: "14.0"
odoo_org_repo: "oca/ocb"
image_name: py3.8-ocb14.0
- python_version: "3.8"
odoo_version: "15.0"
odoo_org_repo: "oca/ocb"
image_name: py3.8-ocb15.0
- python_version: "3.9"
odoo_version: "15.0"
odoo_org_repo: "oca/ocb"
image_name: py3.9-ocb15.0
- python_version: "3.10"
odoo_version: "16.0"
odoo_org_repo: "oca/ocb"
image_name: py3.10-ocb16.0
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v3
with:
build-args: |
python_version=${{ matrix.python_version }}
odoo_version=${{ matrix.odoo_version }}
odoo_org_repo=${{ matrix.odoo_org_repo }}
setuptools_constraint=${{ matrix.setuptools_constraint }}
virtualenv_constraint=${{ matrix.virtualenv_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@v3
- 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@v3
with:
build-args: |
python_version=${{ matrix.python_version }}
odoo_version=${{ matrix.odoo_version }}
odoo_org_repo=${{ matrix.odoo_org_repo }}
setuptools_constraint=${{ matrix.setuptools_constraint }}
virtualenv_constraint=${{ matrix.virtualenv_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' }}