From 2fb6365fabedbb0e8e11cfffc013e70199193929 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Wed, 24 Jan 2024 11:54:48 +0900 Subject: [PATCH] github-action: import all TAOS-CI post-build - gbs build for x64, x86, arm32, arm64 - pdebuild for { x64, arm64 } x { 22.04, 20.04 } - yocto build w/ eSDK (Yocto 4.0.15) - android build w/ nttld/setup-ndk to enable such github actions, - android / jni build script fix Signed-off-by: MyungJoo Ham --- .TAOS-CI/config/config-plugins-postbuild.sh | 15 -- .TAOS-CI/config/config-plugins-prebuild.sh | 144 ------------------ .github/workflows/android.yml | 95 ++++++++++++ .../workflows/{gbs_x64.yml => gbs_build.yml} | 24 ++- .github/workflows/pdebuild.yml | 93 +++++++++++ .github/workflows/yocto.yml | 68 +++++++++ debian/control | 4 +- jni/Android-app.mk | 7 +- jni/Android-nnstreamer.mk | 2 +- 9 files changed, 283 insertions(+), 169 deletions(-) create mode 100644 .github/workflows/android.yml rename .github/workflows/{gbs_x64.yml => gbs_build.yml} (69%) create mode 100644 .github/workflows/pdebuild.yml create mode 100644 .github/workflows/yocto.yml diff --git a/.TAOS-CI/config/config-plugins-postbuild.sh b/.TAOS-CI/config/config-plugins-postbuild.sh index 26f353f4c0..3c8389171f 100644 --- a/.TAOS-CI/config/config-plugins-postbuild.sh +++ b/.TAOS-CI/config/config-plugins-postbuild.sh @@ -15,21 +15,6 @@ declare -i idx=-1 echo "[MODULE] plugins-base: Plugin group is a well-maintained collection of plugin modules." # Please append your plugin modules here. -postbuild_plugins[++idx]="pr-postbuild-build-tizen" -echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder." -echo "[DEBUG] ${postbuild_plugins[idx]} is started." -echo "[DEBUG] ${BOT_NAME}/${postbuild_plugins[idx]}: Check if Tizen rpm package is successfully generated." -echo "[DEBUG] Current path: $(pwd)." -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-base/${postbuild_plugins[idx]}.sh - - -postbuild_plugins[++idx]="pr-postbuild-build-ubuntu" -echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder." -echo "[DEBUG] ${postbuild_plugins[idx]} is started." -echo "[DEBUG] ${BOT_NAME}/${postbuild_plugins[idx]}: Check if Ubuntu deb package is successfully generated." -echo "[DEBUG] Current path: $(pwd)." -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-base/${postbuild_plugins[idx]}.sh - postbuild_plugins[++idx]="pr-postbuild-build-yocto" echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder." diff --git a/.TAOS-CI/config/config-plugins-prebuild.sh b/.TAOS-CI/config/config-plugins-prebuild.sh index 37b90ca4a7..da7253fddb 100644 --- a/.TAOS-CI/config/config-plugins-prebuild.sh +++ b/.TAOS-CI/config/config-plugins-prebuild.sh @@ -16,150 +16,6 @@ declare -i idx=-1 echo "[MODULE] plugins-good: Plugin group that follow Apache license with good quality" # Please append your plugin modules here. -prebuild_plugins[++idx]="pr-prebuild-doxygen-tag" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a source code consists of required doxygen tags." -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-indent" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with GNU indent" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - - -prebuild_plugins[++idx]="pr-prebuild-clang" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with clang-format" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -#prebuild_plugins[++idx]="pr-prebuild-exclusive-vio" -# echo "${prebuild_plugins[idx]} is starting." -# echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check issue #279. VIO commits should not touch non VIO files." -# echo "[DEBUG] The current path: $(pwd)." -# echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -# source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-pylint" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with pylint" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-newline" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if there is a newline issue in text files" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-rpm-spec" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if there is incorrect staements in *.spec file" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-file-size" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the file size to not include big binary files" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-cppcheck" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check dangerous coding constructs in source codes (*.c, *.cpp) with cppcheck" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-nobody" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the commit message body" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-timestamp" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the timestamp of the commit" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-executable" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check executable bits for .cpp, .c, .hpp, .h, .prototxt, .caffemodel, .txt., .init" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-hardcoded-path" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check prohibited hardcoded paths (/home/* for now)" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-misspelling" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a misspelled statement in a document file with GNU Aspell" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-doxygen-build" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a doxygen grammar if a doxygen can normally generate source code" - -prebuild_plugins[++idx]="pr-prebuild-sloccount" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check physical Source Lines of Code (SLOC) in a source code" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-prohibited-words" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if source codes have prohibited words." -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-signed-off-by" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check 'Signed-off-by' in commit body" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-shellcheck" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a syntax error in a shell script file with 'shellcheck' package" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-flawfinder" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check security problems in the C/C++ source code with 'flawfinder' package" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh - -prebuild_plugins[++idx]="pr-prebuild-coverity" -echo "${prebuild_plugins[idx]} is starting." -echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check defects in the C/C++ source code with 'coverity' package" -echo "[DEBUG] The current path: $(pwd)." -echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh" -source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh ################################################################################################################## echo "[MODULE] plugins-staging: Plugin group that does not have an evaluation and aging test enough" diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000000..2dc0400027 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,95 @@ +name: Build test: Android NDK r12b + +on: + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: nttld/setup-ndk@v1 + with: + ndk-version: r12b + link-to-sdk: true + - name: Check if rebuild required + ## @todo This should become a reusable workflow. + run: | + tmpfile=$(mktemp) + git show --pretty="format:" --name-only --diff-filter=AMRC ${{ github.event.pull_request.head.sha}} -${{ github.event.pull_request.commits }} | sort | uniq | awk NF > ${tmpfile} + echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV" + rebuild=`bash .github/workflows/check_if_rebuild_requires.sh ${tmpfile} android | grep "REBUILD=YES" | wc -l` + echo "Rebuild required: ${rebuild}" + echo "rebuild=${rebuild}" >> "$GITHUB_ENV" + - name: make cache key + if: env.rebuild == '1' + id: make-key + run: echo "cache_key=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + shell: bash + - name: cache GST root + id: cache-gbs-root + if: env.rebuild == '1' + uses: actions/cache@v3 + with: + path: ~/android + key: ${{ steps.make-key.outputs.cache_key }} + - name: Prepare Build + if: env.rebuild == '1' + run: | + echo "::group::Install required packages" + sudo apt-get update + sudo apt-get install tar wget gzip libglib2.0-dev libjson-glib-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev googletest liborc-0.4-dev flex bison libopencv-dev pkg-config python3-dev python3-numpy python3 + echo "::endgroup::" + if [[ -d ~/android/gst_root_android/arm64 ]] && [[ -f ~/android/gst_root_android/arm64/lib/libgstreamer-1.0.so ]]; then + echo "Gst-Root-Android cached." + else + echo "::group::Download prebuilt Android-Gstreamer libraries" + mkdir -p ~/android/gst_root_android/arm64 + pushd ~/android/gst_root_android/arm64 + wget http://ci.nnstreamer.ai/warehouse/gstreamer-prebuilts-for-android-device/gst_root_android-custom-1.12.4-ndkr12b-20190213-0900/gstreamer-1.0-android-arm64-1.12.4-runtime.tar.bz2 + wget http://ci.nnstreamer.ai/warehouse/gstreamer-prebuilts-for-android-device/gst_root_android-custom-1.12.4-ndkr12b-20190213-0900/gstreamer-1.0-android-arm64-1.12.4.tar.bz2 + tar -xf gstreamer-1.0-android-arm64-1.12.4-runtime.tar.bz2 + tar -xf gstreamer-1.0-android-arm64-1.12.4.tar.bz2 + popd + echo "::endgroup::" + fi + - name: NDK Build + if: env.rebuild == '1' + run: | + export GSTREAMER_ROOT_ANDROID=~/android/gst_root_android + export TARGET_ARCH_ABI=arm64-v8a + export ANDROID_ABI=arm64-v8a + export APP_ALLOW_MISSING_DEPS=true + export NNSTREAMER_ROOT=$(pwd) + target_host=aarch64-linux-android + export AR=$target_host-ar + export AS=$target_host-clang + export CC=$target_host-clang + export CXX=$target_host-clang++ + export LD=$target_host-ld + export STRIP=$target_host-strip + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/android/gst_root_android/arm64/lib/ + cd jni + echo "::group::Build NNStreamer with ndk-build" + ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android-nnstreamer.mk NDK_APPLICATION_MK=./Application.mk -j$(nproc) + echo "::endgroup::" + ls -la ./libs/arm64-v8a/ + cp ./libs/arm64-v8a/libnnstreamer.so $GSTREAMER_ROOT_ANDROID/arm64/lib/gstreamer-1.0/ + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./libs/arm64-v8a + + # Workaround for the gstreamer-android prebuild binary build glitches + result=$(readelf -d ~/android/gst_root_android/arm64/lib/libfontconfig.so | grep "/data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/lib") + if [[ ! -z $result ]]; then + echo "Warning: the given prebuilt binaries for Android have incorrect rpaths." + sudo mkdir -p /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/ + sudo ln -s ~/android/gst_root_android/arm64/lib /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/lib + fi + + echo "::group::Build a test application" + ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android-app.mk NDK_APPLICATION_MK=./Application.mk -j$(nproc) + ls -la /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/lib/ + echo "::endgroup::" + cd .. diff --git a/.github/workflows/gbs_x64.yml b/.github/workflows/gbs_build.yml similarity index 69% rename from .github/workflows/gbs_x64.yml rename to .github/workflows/gbs_build.yml index c8383ab3e8..3bed3704ee 100644 --- a/.github/workflows/gbs_x64.yml +++ b/.github/workflows/gbs_build.yml @@ -1,4 +1,4 @@ -name: GBS Tizen build for x64 from Ubuntu +name: Build and unit test: Tizen/GBS # ${{ github.event.pull_request.commits }} : # commits in this PR # - changed_file_list in GITHUB_ENV: the list of files updated in this pull-request. @@ -10,6 +10,18 @@ on: jobs: build: + strategy: + matrix: + include: + - aarch: "-A x86_64" + option: "--define \"unit_test 1\"" + - aarch: "-A i586" + option: "--define \"unit_test 1\"" + - aarch: "-A armv7l" + option: "--define \"unit_test 0\"" + - aarch: "-A aarch64" + option: "--define \"unit_test 0\"" + runs-on: ubuntu-20.04 steps: @@ -47,7 +59,11 @@ jobs: - name: run GBS if: env.rebuild == '1' run: | - gbs build --skip-srcrpm --define "_skip_debug_rpm 1" + gbs build --skip-srcrpm --define "_skip_debug_rpm 1" ${{ matrix.aarch }} ${{ matrix.option }} + ## Skip nntrainer build test in aarch64. @todo We need #2430 and #2431 in nntrainer.git + if [[ "${{ matrix.aarch }}" == "-A aarch64" ]]; then + echo "rebuild=0" >> "$GITHUB_ENV" + fi - name: get nntrainer if: env.rebuild == '1' uses: actions/checkout@v3 @@ -57,4 +73,6 @@ jobs: - name: run nntrainer GBS build if: env.rebuild == '1' run: | - pushd nntrainer && gbs build --skip-srcrpm --define "unit_test 1" --define "_skip_debug_rpm 1" && popd + pushd nntrainer + gbs build --skip-srcrpm ${{ matrix.aarch }} ${{ matrix.option }} --define "_skip_debug_rpm 1" + popd diff --git a/.github/workflows/pdebuild.yml b/.github/workflows/pdebuild.yml new file mode 100644 index 0000000000..ccd7990c9e --- /dev/null +++ b/.github/workflows/pdebuild.yml @@ -0,0 +1,93 @@ +name: Build and unit test: Pdebuild Ubuntu 22.04 + +# ${{ github.event.pull_request.commits }} : # commits in this PR +# - changed_file_list in GITHUB_ENV: the list of files updated in this pull-request. + +## @todo apply "cache" to pdebuilder cache, or create docker images ready for pdebuild + +on: + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ ubuntu-20.04, ubuntu-22.04 ] + ## ppa/nnstreamer's ubuntu 20.04 has gpgv error: + # E: Release signed by unknown key (key id CADA0F77901522B3) + # The specified keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg may be incorrect or out of date. + # You can find the latest Debian release key at https://ftp-master.debian.org/keys.html + # E: debootstrap failed + # E: Tail of debootstrap.log: + # amd64: ok + # 2024-01-24 15:01:58 URL:http://ppa.launchpad.net/nnstreamer/ppa/ubuntu/dists/focal/InRelease [18035/18035] -> "/var/cache/pbuilder/build/10399/var/lib/apt/lists/partial/ppa.launchpad.net_nnstreamer_ppa_ubuntu_dists_focal_InRelease" [1] + # gpgv: Signature made Wed Jan 24 09:12:55 2024 UTC + # gpgv: using RSA key 373A37D40E480F96524A4027CADA0F77901522B3 + # gpgv: Can't check signature: No public key + # E: End of debootstrap.log + # W: Aborting with an error + os: [ ubuntu-22.04 ] + arch: [ amd64, arm64 ] + include: + - distroname: jammy + os: ubuntu-22.04 + # - distroname: focal + # os: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check if rebuild required + ## @todo This should become a reusable workflow. + run: | + tmpfile=$(mktemp) + git show --pretty="format:" --name-only --diff-filter=AMRC ${{ github.event.pull_request.head.sha}} -${{ github.event.pull_request.commits }} | sort | uniq | awk NF > ${tmpfile} + echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV" + rebuild=`bash .github/workflows/check_if_rebuild_requires.sh ${tmpfile} debian | grep "REBUILD=YES" | wc -l` + echo "Rebuild required: ${rebuild}" + echo "rebuild=${rebuild}" >> "$GITHUB_ENV" + - uses: actions/setup-python@v1 + - name: make cache key + if: env.rebuild == '1' + id: make-key + run: echo "cache_key=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + shell: bash + - name: cache pbuilder cache + id: cache-pbuilder + if: env.rebuild == '1' + uses: actions/cache@v3 + with: + path: /var/cache/pbuilder + key: ${{ steps.make-key.outputs.cache_key }} + - name: prepare pdebuild + if: env.rebuild == '1' + run: | + echo "Installing build tools" + sudo add-apt-repository ppa:nnstreamer/ppa + echo "::group::apt-get update && apt-get install" + sudo apt-get update && sudo apt-get install -y pbuilder debootstrap curl ubuntu-dev-tools qemu-user-static debian-archive-keyring ubuntu-keyring debhelper + echo "::endgroup::" + echo "DISTRIBUTION=${{ matrix.distroname }}" > ~/.pbuilderrc + echo "OTHERMIRROR=\"deb [trusted=yes] http://archive.ubuntu.com/ubuntu ${{ matrix.distroname }}-backports universe |deb [trusted=yes] http://ppa.launchpad.net/nnstreamer/ppa/ubuntu ${{ matrix.distroname }} main\"" >> ~/.pbuilderrc + cat ~/.pbuilderrc + sudo mkdir -p /root/ + sudo ln -s ~/.pbuilderrc /root/ + echo "=== pbuilder create" + echo "::group::pbuilder create --allow-untrusted" + sudo pbuilder create --allow-untrusted + echo "::endgroup::" + echo "=== pbuilder update" + echo "::group::pbuilder update --distribution ${{ matrix.distroname }}" + sudo pbuilder update --distribution ${{ matrix.distroname }} + echo "::endgroup" + echo "::group::pbuilder update" + sudo pbuilder update + echo "::endgroup" + - name: run pdebuild + if: env.rebuild == '1' + run: | + pdebuild --architecture ${{ matrix.arch }} -- --distribution ${{ matrix.distroname }} diff --git a/.github/workflows/yocto.yml b/.github/workflows/yocto.yml new file mode 100644 index 0000000000..21aa48ad27 --- /dev/null +++ b/.github/workflows/yocto.yml @@ -0,0 +1,68 @@ +name: Build test: Yocto 4.0.15 + +on: + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check if rebuild required + ## @todo This should become a reusable workflow. + run: | + tmpfile=$(mktemp) + git show --pretty="format:" --name-only --diff-filter=AMRC ${{ github.event.pull_request.head.sha}} -${{ github.event.pull_request.commits }} | sort | uniq | awk NF > ${tmpfile} + echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV" + rebuild=`bash .github/workflows/check_if_rebuild_requires.sh ${tmpfile} build | grep "REBUILD=YES" | wc -l` + echo "Rebuild required: ${rebuild}" + echo "rebuild=${rebuild}" >> "$GITHUB_ENV" + - name: make cache key + if: env.rebuild == '1' + id: make-key + run: echo "cache_key=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + shell: bash + - name: cache Yocto SDK + id: cache-gbs-root + if: env.rebuild == '1' + uses: actions/cache@v3 + with: + path: ~/poky_sdk/ + key: ${{ steps.make-key.outputs.cache_key }} + - name: Prepare build + if: env.rebuild == '1' + run: | + echo "::group::apt-get install" + sudo apt-get update + sudo apt-get install sudo curl diffstat python2.7 locales bash-completion qemu gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev gzip libglib2.0-dev libjson-glib-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev googletest liborc-0.4-dev flex bison libopencv-dev pkg-config python3-dev python3-numpy git + sudo ln -sf python2.7 /usr/bin/python + echo "::endgroup::" + echo "::group::Locale Setup" + sudo dpkg-reconfigure locales + sudo locale-gen "en_US.UTF-8" + sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + export LANG=en_US.UTF-8 + export LANGUAGE=en_US:en + locale + echo "::endgroup::" + echo "::group::eSDK install" + ## @todo Find a way to cache this. + if [[ -f ~/poky_sdk/environment-setup-cortexa57-poky-linux ]]; then + echo "There is a cached eSDK. Skip installing" + else + wget -nv https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.15/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-cortexa57-qemuarm64-toolchain-ext-4.0.15.sh + sh poky-glibc-x86_64-core-image-minimal-cortexa57-qemuarm64-toolchain-ext-4.0.15.sh -d ~/poky_sdk + fi + echo "::endgroup::" + - name: Build + if: env.rebuild == '1' + run: | + # Get meta-nerual-network + . ~/poky_sdk/environment-setup-cortexa57-poky-linux + devtool add metaneuralnetwork http://github.com/nnstreamer/meta-neural-network.git + devtool build metaneuralnetwork diff --git a/debian/control b/debian/control index 800e416e01..d8bcb43283 100644 --- a/debian/control +++ b/debian/control @@ -1,11 +1,9 @@ -### PPA does NOT use this file! ### -### Rule file will override! ### Source: nnstreamer Section: libs Priority: optional Maintainer: MyungJoo Ham Build-Depends: gcc-9 | gcc-8 | gcc-7 | gcc-6 | gcc-5 (>=5.4), - ninja-build, meson (>=0.50), debhelper (>=9), nnstreamer-edge-dev, + ninja-build, meson (>=0.49), debhelper (>=9), nnstreamer-edge-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libglib2.0-dev, libjson-glib-dev, gstreamer1.0-tools, gstreamer1.0-plugins-base, gstreamer1.0-plugins-good, libgtest-dev, ssat, libpng-dev, libopencv-dev, liborc-0.4-dev, flex, bison, diff --git a/jni/Android-app.mk b/jni/Android-app.mk index fd6626dbf4..a384b5fee7 100644 --- a/jni/Android-app.mk +++ b/jni/Android-app.mk @@ -89,7 +89,7 @@ gstvideoconvert gstvideorate gstvideoscale \ gmodule-2.0 iconv png16 gstpng gstmultifile gio-2.0 \ gstbase-1.0 gstvideo-1.0 tag-1.0 orc app-1.0 badbase-1.0 gthread \ cairo pixman gstbadvideo gstcontroller jpeg gstpbutils gstallocators \ -bz2 harfbuzz nnstreamer +bz2 harfbuzz z nnstreamer ifeq ($(NO_AUDIO), false) @@ -104,8 +104,9 @@ LOCAL_MODULE := tensor_repo_dynamic_test LOCAL_SRC_FILES += ../tests/nnstreamer_repo_dynamicity/tensor_repo_dynamic_test.c LOCAL_CFLAGS += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\" LOCAL_CXXFLAGS += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\" -LOCAL_LDLIBS := -llog -LOCAL_LDFLAGS := $(CUSTOM_LINKER64) +LOCAL_LDLIBS += -llog +#LOCAL_LDFLAGS += $(CUSTOM_LINKER64) +LOCAL_LDFLAGS += -fuse-ld=bfd LOCAL_C_INCLUDES := $(NNSTREAMER_INCLUDES) LOCAL_SHARED_LIBRARIES := $(BUILDING_BLOCK_LIST) diff --git a/jni/Android-nnstreamer.mk b/jni/Android-nnstreamer.mk index 67da9a54eb..9d4f7dc333 100644 --- a/jni/Android-nnstreamer.mk +++ b/jni/Android-nnstreamer.mk @@ -120,7 +120,7 @@ gstvideoconvert gstvideorate gstvideoscale \ gmodule-2.0 iconv png16 gstpng gstmultifile gio-2.0 \ gstbase-1.0 gstvideo-1.0 tag-1.0 orc app-1.0 badbase-1.0 gthread \ cairo pixman gstbadvideo gstcontroller jpeg gstpbutils gstallocators \ -bz2 harfbuzz +bz2 harfbuzz z ifeq ($(NO_AUDIO), false) BUILDING_BLOCK_LIST += gstaudio-1.0 gstbadaudio-1.0 gstaudioconvert gstaudiomixer gstaudiorate gstaudioresample gstaudiotestsrc