From b8ea4e25797650a1209e0cdeefc3d6967954b016 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 8 Apr 2024 11:18:25 +0200 Subject: [PATCH] fixup! Build libzim with new archive for kiwix-build. --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbe03993..8462c72e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,16 @@ jobs: - 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: @@ -46,21 +56,21 @@ jobs: shell: bash run: | MESON_OPTION="--default-library=shared" - MESON_CROSSFILE="$HOME/BUILD_${{matrix.target}}/meson_cross_file.txt" - if [[ ! "${{matrix.target}}" =~ native_.* ]]; then + 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.target}}/INSTALL/lib/pkgconfig + export PKG_CONFIG_PATH=$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig meson . build ${MESON_OPTION} cd build ninja - name: Test - if: startsWith(matrix.target, 'native_') + if: matrix.run_test shell: bash run: | - export LD_LIBRARY_PATH=$HOME/BUILD_${{matrix.target}}/INSTALL/lib:$HOME/BUILD_${{matrix.target}}/INSTALL/lib64 + 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 @@ -121,30 +131,57 @@ jobs: - 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 @@ -164,7 +201,7 @@ jobs: - name: Compile source code shell: bash env: - PKG_CONFIG_PATH: ${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:${{env.HOME}}/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig + 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 @@ -173,9 +210,9 @@ jobs: MESON_OPTION="--default-library=static" fi - if [ -e "${{ env.HOME }}/BUILD_${{ matrix.target }}/meson_cross_file.txt" ] + if [ -e "${{ env.HOME }}/BUILD_${{ matrix.arch_name }}/meson_cross_file.txt" ] then - MESON_OPTION="$MESON_OPTION --cross-file ${{ env.HOME }}/BUILD_${{ matrix.target }}/meson_cross_file.txt" + 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 @@ -196,7 +233,7 @@ jobs: - name: Run automated tests shell: bash - if: startsWith(matrix.target, 'native_') || startsWith(matrix.target, 'alpine_') + 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 @@ -205,12 +242,12 @@ jobs: cd build ninja download_test_data meson test --verbose - if [[ "${{matrix.target}}" =~ native_.* ]]; then + if [[ "${{matrix.coverage}}" = "true" ]]; then ninja coverage fi - name: Upload code coverage uses: codecov/codecov-action@v3 - if: startsWith(matrix.target, 'native_') + if: matrix.coverage with: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}