Skip to content

Build libzim with new archive for kiwix-build. #1860

Build libzim with new archive for kiwix-build.

Build libzim with new archive for kiwix-build. #1860

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
macOS:
strategy:
fail-fast: false
matrix:
os:
- macos-13
target:
- macos_x86_64-dyn
- ios-arm64-dyn
- ios-x86_64-dyn
include:
- target: macos_x86_64-dyn
arch_name: macos_x86_64
run_test: true
- target: ios-arm64-dyn
arch_name: ios-arm64
run_test: false
- target: ios-x86_64-dyn
arch_name: ios-x86_64
run_test: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install packages
run: |
brew update
brew install gcovr pkg-config ninja || brew link --overwrite python
- name: Install python modules
run: pip3 install meson pytest
- name: Install dependencies
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
with:
os_name: macos
target_platform: ${{ matrix.target }}
- name: Compile
shell: bash
run: |
MESON_OPTION="--default-library=shared"
MESON_CROSSFILE="$HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt"
if [ -e $MESON_CROSSFILE ]; then
MESON_OPTION="$MESON_OPTION --cross-file $MESON_CROSSFILE -Dstatic-linkage=true"
cat $MESON_CROSSFILE
fi
export PKG_CONFIG_PATH=$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig
meson . build ${MESON_OPTION}
cd build
ninja
- name: Test
if: matrix.run_test
shell: bash
run: |
export LD_LIBRARY_PATH=$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib:$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib64
cd build
ninja download_test_data
meson test --verbose
env:
SKIP_BIG_MEMORY_TEST: 1
WAIT_TIME_FACTOR_TEST: 10
Windows:
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install packages
run:
choco install ninja
- name: Install python modules
run: pip3 install meson
- name: Compile
shell: cmd
run: .github\script\build_libzim.cmd
- name: Test
shell: cmd
run: |
cd build
ninja download_test_data
meson test --verbose
env:
WAIT_TIME_FACTOR_TEST: 10
Linux:
strategy:
fail-fast: false
matrix:
target:
- linux-x86_64-static
- linux-x86_64-dyn
- linux-aarch64-musl-dyn
- linux-aarch64-dyn
- android-arm
- android-arm64
- win32-static
- win32-dyn
- wasm
with_xapian:
- true
- false
include:
- target: linux-x86_64-static
image_variant: focal
lib_postfix: '/x86_64-linux-gnu'
arch_name: linux-x86_64
run_test: true
coverage: true
- target: linux-x86_64-dyn
image_variant: focal
lib_postfix: '/x86_64-linux-gnu'
arch_name: linux-x86_64
run_test: true
coverage: true
- target: linux-aarch64-musl-dyn
image_variant: alpine
lib_postfix: '/x86_64-linux-musl'
arch_name: linux-aarch64-musl
run_test: true
coverage: false
- target: linux-aarch64-dyn
image_variant: focal
lib_postfix: '/aarch64-linux-gnu'
arch_name: linux-aarch64
run_test: false
coverage: false
- target: android-arm
image_variant: focal
lib_postfix: '/arm-linux-androideabi'
arch_name: android-arm
run_test: false
coverage: false
- target: android-arm64
image_variant: focal
lib_postfix: '/aarch64-linux-android'
arch_name: android-arm64
run_test: false
coverage: false
- target: win32-static
image_variant: f35
lib_postfix: '64'
arch_name: win32
run_test: false
coverage: false
- target: win32-dyn
image_variant: f35
lib_postfix: '64'
arch_name: win32
run_test: false
coverage: false
- target: wasm
image_variant: focal
lib_postfix: '/x86_64-linux-gnu'
arch_name: linux-x86_64
run_test: false
coverage: false
env:
HOME: /home/runner
runs-on: ubuntu-22.04
container:
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2023-10-30"
steps:
- name: Install dependencies
if: false == startsWith(matrix.target, 'alpine_')
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
with:
target_platform: ${{ matrix.target }}
- name: Retrieve source code
uses: actions/checkout@v3
- name: Compile source code
shell: bash
env:
PKG_CONFIG_PATH: ${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig:${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig
run: |
if [[ "${{matrix.target}}" =~ .*-dyn ]]
then
MESON_OPTION="--default-library=shared"
else
MESON_OPTION="--default-library=static"
fi
if [ -e "${{ env.HOME }}/BUILD_${{ matrix.arch_name }}/meson_cross_file.txt" ]
then
MESON_OPTION="$MESON_OPTION --cross-file ${{ env.HOME }}/BUILD_${{ matrix.arch_name }}/meson_cross_file.txt"
else
MESON_OPTION="$MESON_OPTION -Db_coverage=true"
fi
if [[ "${{matrix.target}}" =~ android_.* ]]
then
MESON_OPTION="$MESON_OPTION -Dstatic-linkage=true -DUSE_BUFFER_HEADER=false"
fi
if [[ "${{matrix.target}}" == wasm ]]
then
MESON_OPTION="$MESON_OPTION -Dexamples=false"
fi
meson setup . build ${MESON_OPTION} -Dwith_xapian=${{matrix.with_xapian}}
cd build
ninja
- name: Run automated tests
shell: bash
if: matrix.run_test
env:
LD_LIBRARY_PATH: "${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib:${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}"
SKIP_BIG_MEMORY_TEST: 1
WAIT_TIME_FACTOR_TEST: 10
run: |
cd build
ninja download_test_data
meson test --verbose
if [[ "${{matrix.coverage}}" = "true" ]]; then
ninja coverage
fi
- name: Upload code coverage
uses: codecov/codecov-action@v3
if: matrix.coverage
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}