Skip to content

Commit

Permalink
Various changes for Altinkaya workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yibudak committed Dec 18, 2024
1 parent 2ab8a83 commit 356dadc
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 176 deletions.
115 changes: 12 additions & 103 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,102 +19,12 @@ jobs:
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"
- python_version: "3.11"
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
odoo_version: "16.0web"
odoo_org_repo: "altinkaya-opensource/odoo"
image_name: py3.11-odoo-16.0web

services:
postgres:
image: postgres:12
Expand Down Expand Up @@ -143,32 +53,31 @@ jobs:
odoo_org_repo=${{ matrix.odoo_org_repo }}
setuptools_constraint=${{ matrix.setuptools_constraint }}
tags: |
ghcr.io/oca/oca-ci/${{ matrix.image_name }}:latest
ghcr.io/altinkaya-opensource/altinkaya-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-from: type=registry,ref=ghcr.io/altinkaya-opensource/altinkaya-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: Tests
# run: docker run -v ${PWD}/tests:/mnt/tests --network=host -e PGHOST=localhost ghcr.io/altinkaya-opensource/altinkaya-ci/${{ matrix.image_name }}:latest /mnt/tests/runtests.sh -v
- name: Push image
uses: docker/build-push-action@v6
with:
context: .
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
ghcr.io/altinkaya-opensource/altinkaya-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' }}
if: ${{ github.repository_owner == 'altinkaya-opensource' && github.ref == 'refs/heads/master' }}
135 changes: 63 additions & 72 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG codename=focal
ARG codename=jammy

FROM ubuntu:$codename
ENV LANG=C.UTF-8
Expand All @@ -7,22 +7,22 @@ USER root
# Basic dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq --no-install-recommends \
ca-certificates \
curl \
gettext \
git \
gnupg \
lsb-release \
software-properties-common \
expect-dev \
pipx
ca-certificates \
curl \
gettext \
git \
gnupg \
lsb-release \
software-properties-common \
expect-dev \
pipx

ENV PIPX_BIN_DIR=/usr/local/bin

# Install wkhtml
RUN case $(lsb_release -c -s) in \
focal) WKHTML_DEB_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb ;; \
jammy) WKHTML_DEB_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb ;; \
focal) WKHTML_DEB_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb ;; \
jammy) WKHTML_DEB_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb ;; \
esac \
&& curl -sSL $WKHTML_DEB_URL -o /tmp/wkhtml.deb \
&& apt-get update -qq \
Expand All @@ -31,10 +31,10 @@ RUN case $(lsb_release -c -s) in \

# Install nodejs dependencies
RUN case $(lsb_release -c -s) in \
focal) NODE_SOURCE="deb https://deb.nodesource.com/node_15.x focal main" \
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - ;; \
jammy) NODE_SOURCE="deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg ;; \
focal) NODE_SOURCE="deb https://deb.nodesource.com/node_15.x focal main" \
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - ;; \
jammy) NODE_SOURCE="deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg ;; \
esac \
&& echo "$NODE_SOURCE" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq \
Expand All @@ -48,11 +48,11 @@ RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq postgresql-client-12

# Install Google following Odoo's Runbot guideline https://github.com/odoo/runbot/blob/f8f435d468135486146a2e61e8d15d0f453c0e15/runbot/data/dockerfile_data.xml#L139-L140
RUN curl -sSL https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_126.0.6478.182-1_amd64.deb -o /tmp/chrome.deb \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends /tmp/chrome.deb \
&& rm /tmp/chrome.deb
# # Install Google following Odoo's Runbot guideline https://github.com/odoo/runbot/blob/f8f435d468135486146a2e61e8d15d0f453c0e15/runbot/data/dockerfile_data.xml#L139-L140
# RUN curl -sSL https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_126.0.6478.182-1_amd64.deb -o /tmp/chrome.deb \
# && apt-get update -qq \
# && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends /tmp/chrome.deb \
# && rm /tmp/chrome.deb

RUN add-apt-repository -y ppa:deadsnakes/ppa

Expand All @@ -61,32 +61,32 @@ ARG python_version
# Install build dependencies for python libs commonly used by Odoo and OCA
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq --no-install-recommends \
build-essential \
python${python_version}-dev \
python${python_version}-venv \
# we need python 3 for our helper scripts
python3 \
python3-venv \
# for psycopg
libpq-dev \
# for lxml
libxml2-dev \
libxslt1-dev \
libz-dev \
libxmlsec1-dev \
# for python-ldap
libldap2-dev \
libsasl2-dev \
# need libjpeg to build older pillow versions
libjpeg-dev \
# for pycups
libcups2-dev \
# for mysqlclient \
default-libmysqlclient-dev \
# some other build tools
swig \
libffi-dev \
pkg-config
build-essential \
python${python_version}-dev \
python${python_version}-venv \
# we need python 3 for our helper scripts
python3 \
python3-venv \
# for psycopg
libpq-dev \
# for lxml
libxml2-dev \
libxslt1-dev \
libz-dev \
libxmlsec1-dev \
# for python-ldap
libldap2-dev \
libsasl2-dev \
# need libjpeg to build older pillow versions
libjpeg-dev \
# for pycups
libcups2-dev \
# for mysqlclient \
default-libmysqlclient-dev \
# some other build tools
swig \
libffi-dev \
pkg-config

# We use manifestoo to check licenses, development status and list addons and dependencies
RUN pipx install --pip-args="--no-cache-dir" "manifestoo>=0.3.1"
Expand All @@ -108,34 +108,25 @@ ENV PATH=/opt/odoo-venv/bin:$PATH

ARG odoo_version

# Install Odoo requirements (use ADD for correct layer caching).
# We use requirements from OCB for easier maintenance of older versions.
ADD https://raw.githubusercontent.com/OCA/OCB/$odoo_version/requirements.txt /tmp/ocb-requirements.txt
# The sed command is to use the latest version of gevent and greenlet. The
# latest version works with all versions of Odoo that we support here, and the
# oldest pinned in Odoo's requirements.txt don't have wheels, and don't build
# anymore with the latest cython.
RUN sed -i -E "s/^(gevent|greenlet)==.*/\1/" /tmp/ocb-requirements.txt \
&& pip install --no-cache-dir \
-r /tmp/ocb-requirements.txt \
packaging

# Install other test requirements.
# - coverage
# - websocket-client is required for Odoo browser tests
RUN pip install --no-cache-dir \
coverage \
websocket-client

# Install Odoo (use ADD for correct layer caching)
ARG odoo_org_repo=odoo/odoo
ADD https://api.github.com/repos/$odoo_org_repo/git/refs/heads/$odoo_version /tmp/odoo-version.json
RUN mkdir /tmp/getodoo \
&& (curl -sSL https://github.com/$odoo_org_repo/tarball/$odoo_version | tar -C /tmp/getodoo -xz) \
&& mv /tmp/getodoo/* /opt/odoo \
&& rmdir /tmp/getodoo
RUN pip install --no-cache-dir -e /opt/odoo \
&& pip list
coverage \
websocket-client

# yigit: We don't need to install odoo from github, we will use our own odoo version.

# # Install Odoo (use ADD for correct layer caching)
# ARG odoo_org_repo=odoo/odoo
# ADD https://api.github.com/repos/$odoo_org_repo/git/refs/heads/$odoo_version /tmp/odoo-version.json
# RUN mkdir /tmp/getodoo \
# && (curl -sSL https://github.com/$odoo_org_repo/tarball/$odoo_version | tar -C /tmp/getodoo -xz) \
# && mv /tmp/getodoo/* /opt/odoo \
# && rmdir /tmp/getodoo
# RUN pip install --no-cache-dir -e /opt/odoo \
# && pip list

# Make an empty odoo.cfg
RUN echo "[options]" > /etc/odoo.cfg
Expand All @@ -160,6 +151,6 @@ ENV ADDONS_DIR=.
ENV ADDONS_PATH=/opt/odoo/addons
ENV INCLUDE=
ENV EXCLUDE=
ENV OCA_GIT_USER_NAME=oca-ci
ENV OCA_GIT_USER_EMAIL=[email protected]
ENV OCA_GIT_USER_NAME=altinkaya-bot
ENV OCA_GIT_USER_EMAIL=[email protected]
ENV OCA_ENABLE_CHECKLOG_ODOO=
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Container image to run OCA CI tests
# Container image to run Altinkaya CI tests

⚠️ These images are meant for running CI tests of the Odoo Community
Association. They are *not* intended for any other purpose, and in particular
Expand Down

0 comments on commit 356dadc

Please sign in to comment.