Build libkiwix with new archive from kiwix-build

This commit is contained in:
Matthieu Gautier 2024-04-08 15:46:27 +02:00
parent 66693cd73e
commit f0927fec49
1 changed files with 63 additions and 39 deletions

View File

@ -14,9 +14,19 @@ jobs:
os: os:
- macos-13 - macos-13
target: target:
- native_dyn - macos-x86_64-dyn
- iOS_arm64 - ios-arm64-dyn
- iOS_x86_64 - ios-x86_64-dyn
include:
- target: macos-x86_64-dyn
arch_name: x86_64-apple-darwin
run_test: true
- target: ios-arm64-dyn
arch_name: aarch64-apple-ios
run_test: true
- target: ios-x86_64-dyn
arch_name: x86-apple-ios-simulator
run_test: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env: env:
@ -43,61 +53,73 @@ jobs:
- name: Compile - name: Compile
env: env:
PKG_CONFIG_PATH: ${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig PKG_CONFIG_PATH: ${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig
CPPFLAGS: -I${{env.HOME}}/BUILD_native_dyn/INSTALL/include CPPFLAGS: -I${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/include
MESON_OPTION: --default-library=shared -Db_coverage=true MESON_OPTION: --default-library=shared -Db_coverage=true
MESON_CROSSFILE: ${{env.HOME}}/BUILD_${{matrix.target}}/meson_cross_file.txt MESON_CROSSFILE: ${{env.HOME}}/BUILD_${{matrix.arch_name}}/meson_cross_file.txt
shell: bash shell: bash
run: | run: |
if [[ ! "${{matrix.target}}" =~ native_.* ]]; then if [ -e $MESON_CROSSFILE ]; then
MESON_OPTION="$MESON_OPTION --cross-file $MESON_CROSSFILE -Dstatic-linkage=true" MESON_OPTION="$MESON_OPTION --cross-file $MESON_CROSSFILE -Dstatic-linkage=true"
fi fi
meson . build ${MESON_OPTION} meson . build ${MESON_OPTION}
ninja -C build ninja -C build
- name: Test libkiwix - name: Test libkiwix
if: startsWith(matrix.target, 'native_') if: matrix.run_test
env: env:
SKIP_BIG_MEMORY_TEST: 1 SKIP_BIG_MEMORY_TEST: 1
LD_LIBRARY_PATH: ${{env.HOME}}/BUILD_native_dyn/INSTALL/lib:${{env.HOME}}/BUILD_native_dyn/INSTALL/lib64 LD_LIBRARY_PATH: ${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib:${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib64
run: meson test -C build --verbose run: meson test -C build --verbose
Linux: Linux:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
name: target:
- native_static - linux-x86_64-static
- native_dyn - linux-x86_64-dyn
- android_arm - android-arm
- android_arm64 - android-arm64
- win32_static - win32-static
- win32_dyn - win32-dyn
include: include:
- name: native_static - target: linux-x86_64-static
target: native_static
image_variant: focal image_variant: focal
lib_postfix: '/x86_64-linux-gnu' lib_postfix: '/x86_64-linux-gnu'
- name: native_dyn arch_name: linux-x86_64
target: native_dyn run_test: true
coverage: true
- target: linux-x86_64-dyn
image_variant: focal image_variant: focal
lib_postfix: '/x86_64-linux-gnu' lib_postfix: '/x86_64-linux-gnu'
- name: android_arm arch_name: linux-x86_64
target: android_arm run_test: true
coverage: true
- target: android-arm
image_variant: focal image_variant: focal
lib_postfix: '/arm-linux-androideabi' lib_postfix: '/arm-linux-androideabi'
- name: android_arm64 arch_name: arm-linux-androideabi
target: android_arm64 run_test: false
coverage: false
- target: android-arm64
image_variant: focal image_variant: focal
lib_postfix: '/aarch64-linux-android' lib_postfix: '/aarch64-linux-android'
- name: win32_static arch_name: aarch64-linux-android
target: win32_static run_test: false
coverage: false
- target: win32-static
image_variant: f35 image_variant: f35
lib_postfix: '64' lib_postfix: '64'
- name: win32_dyn arch_name: i686-w64-mingw32
target: win32_dyn run_test: false
coverage: false
- target: win32-dyn
image_variant: f35 image_variant: f35
lib_postfix: '64' lib_postfix: '64'
arch_name: i686-w64-mingw32
run_test: false
coverage: false
env: env:
HOME: /home/runner HOME: /home/runner
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@ -114,38 +136,40 @@ jobs:
shell: bash shell: bash
run: | run: |
meson --version meson --version
if [[ "${{matrix.target}}" =~ .*_dyn ]]; then if [[ "${{matrix.target}}" =~ .*-dyn ]]; then
MESON_OPTION="--default-library=shared" MESON_OPTION="--default-library=shared"
else else
MESON_OPTION="--default-library=static" MESON_OPTION="--default-library=static"
fi fi
if [[ "${{matrix.target}}" =~ native_.* ]]; then if [ -e "${{env.HOME}}/BUILD_${{matrix.arch_name}}/meson_cross_file.txt" ]; then
MESON_OPTION="$MESON_OPTION -Db_coverage=true" MESON_OPTION="$MESON_OPTION --cross-file ${{env.HOME}}/BUILD_${{matrix.arch_name}}/meson_cross_file.txt"
else else
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.target}}/meson_cross_file.txt" MESON_OPTION="$MESON_OPTION -Db_coverage=true"
fi fi
if [[ "${{matrix.target}}" =~ android_.* ]]; then if [[ "${{matrix.target}}" =~ android-.* ]]; then
MESON_OPTION="$MESON_OPTION -Dstatic-linkage=true" MESON_OPTION="$MESON_OPTION -Dstatic-linkage=true"
fi fi
meson . build ${MESON_OPTION} meson . build ${MESON_OPTION}
cd build cd build
ninja ninja
env: env:
PKG_CONFIG_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig" PKG_CONFIG_PATH: "/home/runner/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig:/home/runner/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
CPPFLAGS: "-I/home/runner/BUILD_${{matrix.target}}/INSTALL/include" CPPFLAGS: "-I/home/runner/BUILD_${{matrix.arch_name}}/INSTALL/include"
- name: Test - name: Test
if: startsWith(matrix.target, 'native_') if: matrix.run_test
shell: bash shell: bash
run: | run: |
cd build cd build
meson test --verbose meson test --verbose
ninja coverage if [[ "${{matrix.coverage}}" = "true" ]]; then
ninja coverage
fi
env: env:
LD_LIBRARY_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}" LD_LIBRARY_PATH: "/home/runner/BUILD_${{matrix.arch_name}}/INSTALL/lib:/home/runner/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}"
SKIP_BIG_MEMORY_TEST: 1 SKIP_BIG_MEMORY_TEST: 1
- name: Publish coverage - name: Publish coverage
if: startsWith(matrix.target, 'native_') if: matrix.coverage
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}