Add a GithubAction CI to build the docker images.

No really useful for now. But will be in next commit.
This commit is contained in:
Matthieu Gautier 2020-01-20 22:58:10 +01:00
parent 2f151df63c
commit ce45966d40
5 changed files with 149 additions and 0 deletions

View File

@ -0,0 +1,33 @@
FROM ubuntu:bionic
ENV LANG C.UTF-8
ENV OS_NAME bionic
RUN apt update -q \
&& apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build openssh-client \
# Packaged dependencies
libbz2-dev libmagic-dev uuid-dev zlib1g-dev \
libmicrohttpd-dev aria2 libgtest-dev \
# Qt packages
libqt5gui5 qtbase5-dev qtwebengine5-dev libqt5svg5-dev qt5-image-formats-plugins qt5-default \
# To create the appimage of kiwix-desktop
libfuse2 fuse patchelf \
# Flatpak tools
elfutils flatpak flatpak-builder \
# Cross win32 compiler
g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools \
# Other tools (to remove)
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
# Create user
RUN useradd --create-home runner
USER runner
WORKDIR /home/runner
ENV PATH /home/runner/.local/bin:$PATH

View File

@ -0,0 +1,25 @@
FROM fedora:30
ENV LANG C.UTF-8
ENV OS_NAME f30
RUN dnf install -y --nodocs \
# Base build tools
make automake libtool cmake git-core subversion pkg-config gcc-c++ \
wget unzip ninja-build ccache which patch gcovr xz openssh-clients \
# Cross win32 compiler
mingw32-gcc-c++ mingw32-bzip2-static mingw32-win-iconv-static \
mingw32-winpthreads-static mingw32-zlib-static mingw32-xz-libs-static \
mingw32-libmicrohttpd \
# Other tools (to remove)
# vim less grep
&& dnf remove -y "*-doc" \
&& dnf autoremove -y \
&& dnf clean all \
&& pip3 install meson==0.52.1 pytest
# Create user
RUN useradd --create-home runner
USER runner
WORKDIR /home/runner
ENV PATH /home/runner/.local/bin:$PATH

View File

@ -0,0 +1,33 @@
FROM ubuntu:focal
ENV LANG C.UTF-8
ENV OS_NAME focal
RUN apt update -q \
&& apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build openssh-client \
# Packaged dependencies
libbz2-dev libmagic-dev uuid-dev zlib1g-dev \
libmicrohttpd-dev aria2 libgtest-dev \
# Qt packages
libqt5gui5 qtbase5-dev qtwebengine5-dev libqt5svg5-dev qt5-image-formats-plugins qt5-default \
# To create the appimage of kiwix-desktop
libfuse2 fuse patchelf \
# Flatpak tools
elfutils flatpak flatpak-builder \
# Cross win32 compiler
g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools \
# Other tools (to remove)
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
# Create user
RUN useradd --create-home runner
USER runner
WORKDIR /home/runner
ENV PATH /home/runner/.local/bin:$PATH

View File

@ -0,0 +1,30 @@
FROM ubuntu:xenial
ENV LANG C.UTF-8
ENV OS_NAME xenial
RUN apt update -q \
&& dpkg --add-architecture i386 \
&& apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build openssh-client \
# Python (2) is needed to install android-ndk
python \
# Packaged dependencies
libbz2-dev libmagic-dev uuid-dev zlib1g-dev default-jdk \
libmicrohttpd-dev libgtest-dev \
# Cross compile i586
libc6-dev-i386 lib32stdc++6 gcc-multilib g++-multilib \
# Other tools (to remove)
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
# Create user
RUN useradd --create-home runner
USER runner
WORKDIR /home/runner
ENV PATH /home/runner/.local/bin:$PATH

28
.github/workflows/base.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Build Base
on: [push]
env:
DOCKER_VERSION: 25
jobs:
Docker:
strategy:
fail-fast: false
matrix:
variant: [xenial, bionic, f30, focal]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker image
shell: bash
run: |
TAGNAME=${{matrix.variant}}-${DOCKER_VERSION}
if [ ! $(curl -sflL https://hub.docker.com/v2/repositories/kiwix/kiwix-build_ci/tags/${TAGNAME}) ]
then
echo "${{secrets.docker_password}}" | docker login -u "${{secrets.docker_username}}" --password-stdin
FULLTAGNAME=kiwix/kiwix-build_ci:${TAGNAME}
docker build -t ${FULLTAGNAME} - < ${GITHUB_WORKSPACE}/.github/ci_images/${{matrix.variant}}_builder.dockerfile
docker push ${FULLTAGNAME}
fi