185 lines
5.1 KiB
YAML
185 lines
5.1 KiB
YAML
name: Build Base
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
- cron: '*/20 * * * *'
|
|
|
|
env:
|
|
DOCKER_VERSION: 26
|
|
|
|
jobs:
|
|
Docker:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant: [xenial, bionic, f31, 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
|
|
|
|
Linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- native_static
|
|
- native_dyn
|
|
- native_mixed
|
|
- native_desktop
|
|
- armhf_static
|
|
- armhf_dyn
|
|
- win32_static
|
|
- win32_dyn
|
|
- i586_static
|
|
- i586_dyn
|
|
- android_arm
|
|
- android_arm64
|
|
- android_x86
|
|
- android_x86_64
|
|
include:
|
|
- target: native_static
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: native_dyn
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: native_mixed
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: native_desktop
|
|
image_variant: bionic
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: armhf_static
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: armhf_dyn
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: win32_static
|
|
image_variant: f31
|
|
lib_postfix: '64'
|
|
- target: win32_dyn
|
|
image_variant: f31
|
|
lib_postfix: '64'
|
|
- target: i586_static
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: i586_dyn
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: android_arm
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: android_arm64
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: android_x86
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: android_x86_64
|
|
image_variant: xenial
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
env:
|
|
HOME: /home/runner
|
|
SSH_KEY: /tmp/id_rsa
|
|
runs-on: ubuntu-latest
|
|
needs: Docker
|
|
container:
|
|
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26"
|
|
steps:
|
|
- name: Checkout code
|
|
shell: bash
|
|
run: |
|
|
cd $HOME
|
|
git clone https://github.com/${REP} --depth=1 --branch ${GITHUB_REF##*/}
|
|
pip3 install --user --no-deps ./${REP##*/}
|
|
env:
|
|
REP: ${{github.repository}}
|
|
- name: secret
|
|
shell: bash
|
|
run: |
|
|
echo "${{secrets.ssh_key}}" > $SSH_KEY
|
|
chmod 600 $SSH_KEY
|
|
- name: Ensure base deps
|
|
shell: bash
|
|
run: |
|
|
cd $HOME
|
|
kiwix-build/.github/scripts/ensure_base_deps.py
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|
|
- name: Compile all deps
|
|
shell: bash
|
|
run: |
|
|
cd $HOME
|
|
kiwix-build/.github/scripts/compile_all_deps.py
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|
|
- name: Upload failure logs
|
|
if: failure()
|
|
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.sh
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|
|
|
|
|
|
Macos:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- native_dyn
|
|
runs-on: macos-latest
|
|
env:
|
|
SSH_KEY: /tmp/id_rsa
|
|
OS_NAME: osx
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v1
|
|
- name: Setup python 3.6
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: '3.6'
|
|
- name: Install packages
|
|
uses: mstksg/get-package@v1
|
|
with:
|
|
brew: pkg-config ninja
|
|
- name: Install python modules
|
|
run: |
|
|
pip3 install meson==0.52.1 pytest
|
|
pip3 install --no-deps $GITHUB_WORKSPACE
|
|
- name: secret
|
|
shell: bash
|
|
run: |
|
|
echo "${{secrets.ssh_key}}" > $SSH_KEY
|
|
chmod 600 $SSH_KEY
|
|
- name: Ensure base deps
|
|
shell: bash
|
|
run: |
|
|
cd $HOME
|
|
$GITHUB_WORKSPACE/.github/scripts/ensure_base_deps.py
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|
|
- name: Compile all deps
|
|
shell: bash
|
|
run: |
|
|
cd $HOME
|
|
$GITHUB_WORKSPACE/.github/scripts/compile_all_deps.py
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|
|
- name: Upload failure logs
|
|
if: failure()
|
|
run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.sh
|
|
env:
|
|
PLATFORM_TARGET: ${{matrix.target}}
|