From 1d84266751edd4b5db772c07fdceb4faa0f86571 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 20 Jan 2020 23:03:43 +0100 Subject: [PATCH] Build all base dependencies. Use a custom script for this. Set `SKIP_BIG_MEMORY_TEST` to avoid launching big test on libzim. --- .github/scripts/common.py | 4 ++- .github/scripts/compile_all_deps.py | 40 +++++++++++++++++++++++++++++ .github/workflows/base.yml | 7 +++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/compile_all_deps.py diff --git a/.github/scripts/common.py b/.github/scripts/common.py index 58ea5c6..c7fcaf9 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -88,7 +88,9 @@ def run_kiwix_build( make_release, make_dist, ) - subprocess.check_call(command, cwd=str(HOME)) + env = dict(_environ) + env['SKIP_BIG_MEMORY_TEST'] = '1' + subprocess.check_call(command, cwd=str(HOME), env=env) print_message("Build ended") diff --git a/.github/scripts/compile_all_deps.py b/.github/scripts/compile_all_deps.py new file mode 100755 index 0000000..2f91ae0 --- /dev/null +++ b/.github/scripts/compile_all_deps.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +import os + +from common import ( + run_kiwix_build, + make_deps_archive, + upload, + OS_NAME, + PLATFORM_TARGET, + KIWIX_DESKTOP_ONLY, +) + +if PLATFORM_TARGET == "android": + TARGETS = ("kiwix-lib-app",) +elif PLATFORM_TARGET.startswith("android_"): + TARGETS = ("libzim", "kiwix-lib") +elif PLATFORM_TARGET.startswith("iOS"): + TARGETS = ("libzim", "kiwix-lib") +elif PLATFORM_TARGET.startswith("native_"): + if OS_NAME == "osx": + TARGETS = ("libzim", "zimwriterfs", "zim-tools", "kiwix-lib") + else: + if PLATFORM_TARGET == "native_dyn" and KIWIX_DESKTOP_ONLY: + TARGETS = ("kiwix-desktop",) + elif PLATFORM_TARGET == "native_mixed": + TARGETS = ("libzim",) + else: + TARGETS = ("libzim", "zimwriterfs", "zim-tools", "kiwix-lib", "kiwix-tools") +elif PLATFORM_TARGET == "flatpak": + TARGETS = ("kiwix-desktop",) +else: + TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools") + +for target in TARGETS: + if PLATFORM_TARGET not in ("android", "flatpak"): + run_kiwix_build(target, platform=PLATFORM_TARGET, build_deps_only=True) + archive_file = make_deps_archive(target=target) + upload(archive_file, "ci@tmp.kiwix.org", "/data/tmp/ci") + os.remove(str(archive_file)) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 72971a8..02a996f 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -84,6 +84,13 @@ jobs: 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