mirror of https://github.com/kiwix/kiwix-tools.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.2 KiB
73 lines
2.2 KiB
name: CI
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
Linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- native_static
|
|
- native_dyn
|
|
- win32_static
|
|
- win32_dyn
|
|
include:
|
|
- target: native_static
|
|
image_variant: bionic
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: native_dyn
|
|
image_variant: bionic
|
|
lib_postfix: '/x86_64-linux-gnu'
|
|
- target: win32_static
|
|
image_variant: f35
|
|
lib_postfix: '64'
|
|
- target: win32_dyn
|
|
image_variant: f35
|
|
lib_postfix: '64'
|
|
env:
|
|
HOME: /home/runner
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-31"
|
|
steps:
|
|
- name: Extract branch name
|
|
shell: bash
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
id: extract_branch
|
|
- name: Checkout code
|
|
shell: python
|
|
run: |
|
|
from subprocess import check_call
|
|
from os import environ
|
|
command = [
|
|
'git', 'clone',
|
|
'https://github.com/${{github.repository}}',
|
|
'--depth=1',
|
|
'--branch', '${{steps.extract_branch.outputs.branch}}'
|
|
]
|
|
check_call(command, cwd=environ['HOME'])
|
|
- name: Install deps
|
|
shell: bash
|
|
run: |
|
|
ARCHIVE_NAME=deps2_${OS_NAME}_${{matrix.target}}_kiwix-tools.tar.xz
|
|
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C /home/runner
|
|
- name: Compile
|
|
shell: bash
|
|
run: |
|
|
if [[ "${{matrix.target}}" =~ .*_static ]]; then
|
|
MESON_OPTION="-Dstatic-linkage=true"
|
|
else
|
|
MESON_OPTION=""
|
|
fi
|
|
if [[ ! "${{matrix.target}}" =~ native_.* ]]; then
|
|
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.target}}/meson_cross_file.txt"
|
|
fi
|
|
cd $HOME/kiwix-tools
|
|
meson . build ${MESON_OPTION}
|
|
cd build
|
|
ninja
|
|
env:
|
|
PKG_CONFIG_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
|
|
CPPFLAGS: "-I/home/runner/BUILD_${{matrix.target}}/INSTALL/include"
|