Skip to content

Merge pull request #38 from acsonefho/docker-update-maintainer #214

Merge pull request #38 from acsonefho/docker-update-maintainer

Merge pull request #38 from acsonefho/docker-update-maintainer #214

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 4 * * 0"
jobs:
build-odoo:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ODOOVERSION: "10.0"
PYTHONTAG: py27
PYTHONBIN: python2.7
DISTRO: jammy
# /!\ python 3.6 and 3.7 are not supported anymore
- ODOOVERSION: "11.0"
PYTHONTAG: py36
PYTHONBIN: python3.6
DISTRO: focal
- ODOOVERSION: "12.0"
PYTHONTAG: py36
PYTHONBIN: python3.6
DISTRO: focal
- ODOOVERSION: "12.0"
PYTHONTAG: py37
PYTHONBIN: python3.7
DISTRO: focal
- ODOOVERSION: "12.0"
PYTHONTAG: py39
PYTHONBIN: python3.9
DISTRO: jammy
- ODOOVERSION: "13.0"
PYTHONTAG: py36
PYTHONBIN: python3.6
DISTRO: focal
- ODOOVERSION: "13.0"
PYTHONTAG: py37
PYTHONBIN: python3.7
DISTRO: focal
- ODOOVERSION: "13.0"
PYTHONTAG: py310
PYTHONBIN: python3.10
DISTRO: focal
- ODOOVERSION: "14.0"
PYTHONTAG: py36
PYTHONBIN: python3.6
DISTRO: focal
- ODOOVERSION: "14.0"
PYTHONTAG: py37
PYTHONBIN: python3.7
DISTRO: focal
- ODOOVERSION: "14.0"
PYTHONTAG: py38
PYTHONBIN: python3.8
DISTRO: focal
- ODOOVERSION: "14.0"
PYTHONTAG: py39
PYTHONBIN: python3.9
DISTRO: focal
- ODOOVERSION: "15.0"
PYTHONTAG: py38
PYTHONBIN: python3.8
DISTRO: focal
- ODOOVERSION: "15.0"
PYTHONTAG: py39
PYTHONBIN: python3.9
DISTRO: focal
- ODOOVERSION: "15.0"
PYTHONTAG: py39
PYTHONBIN: python3.9
DISTRO: jammy
- ODOOVERSION: "16.0"
PYTHONTAG: py39
PYTHONBIN: python3.9
DISTRO: jammy
- ODOOVERSION: "16.0"
PYTHONTAG: py310
PYTHONBIN: python3.10
DISTRO: jammy
- ODOOVERSION: "16.0"
PYTHONTAG: py311
PYTHONBIN: python3.11
DISTRO: jammy
- ODOOVERSION: "16.0"
PYTHONTAG: py312
PYTHONBIN: python3.12
DISTRO: jammy
- ODOOVERSION: "17.0"
PYTHONTAG: py310
PYTHONBIN: python3.10
DISTRO: jammy
- ODOOVERSION: "17.0"
PYTHONTAG: py311
PYTHONBIN: python3.11
DISTRO: jammy
- ODOOVERSION: "17.0"
PYTHONTAG: py312
PYTHONBIN: python3.12
DISTRO: jammy
steps:
- uses: actions/checkout@v4
- 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@v5
with:
context: .
file: Dockerfile-${{ matrix.ODOOVERSION }}
build-args: |
PYTHONBIN=${{ matrix.PYTHONBIN }}
DISTRO=${{ matrix.DISTRO }}
tags: |
ghcr.io/${{ github.repository }}:${{ matrix.ODOOVERSION }}-${{ matrix.PYTHONTAG }}-${{ matrix.DISTRO }}-latest
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:${{ matrix.ODOOVERSION }}-${{ matrix.PYTHONTAG }}-${{ matrix.DISTRO }}-latest
cache-to: type=local,dest=/tmp/.buildx-cache
load: true
- name: Install test pre-requisites
run: pip install pytest
- name: Test
env:
ODOOVERSION: "${{ matrix.ODOOVERSION }}"
PYTHONTAG: "${{ matrix.PYTHONTAG }}"
DISTRO: "${{ matrix.DISTRO }}"
run: pytest -v tests
- name: Push image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-${{ matrix.ODOOVERSION }}
build-args: |
PYTHONBIN=${{ matrix.PYTHONBIN }}
DISTRO=${{ matrix.DISTRO }}
tags: |
ghcr.io/${{ github.repository }}:${{ matrix.ODOOVERSION }}-${{ matrix.PYTHONTAG }}-${{ matrix.DISTRO }}-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=inline
push: true
if: ${{ github.repository_owner == 'acsone' && github.ref == 'refs/heads/master' }}