Skip to content

Commit 2fb6365

Browse files
committed
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 <[email protected]>
1 parent 664018d commit 2fb6365

9 files changed

+283
-169
lines changed

.TAOS-CI/config/config-plugins-postbuild.sh

-15
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ declare -i idx=-1
1515
echo "[MODULE] plugins-base: Plugin group is a well-maintained collection of plugin modules."
1616
# Please append your plugin modules here.
1717

18-
postbuild_plugins[++idx]="pr-postbuild-build-tizen"
19-
echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder."
20-
echo "[DEBUG] ${postbuild_plugins[idx]} is started."
21-
echo "[DEBUG] ${BOT_NAME}/${postbuild_plugins[idx]}: Check if Tizen rpm package is successfully generated."
22-
echo "[DEBUG] Current path: $(pwd)."
23-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-base/${postbuild_plugins[idx]}.sh
24-
25-
26-
postbuild_plugins[++idx]="pr-postbuild-build-ubuntu"
27-
echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder."
28-
echo "[DEBUG] ${postbuild_plugins[idx]} is started."
29-
echo "[DEBUG] ${BOT_NAME}/${postbuild_plugins[idx]}: Check if Ubuntu deb package is successfully generated."
30-
echo "[DEBUG] Current path: $(pwd)."
31-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-base/${postbuild_plugins[idx]}.sh
32-
3318

3419
postbuild_plugins[++idx]="pr-postbuild-build-yocto"
3520
echo "[DEBUG] The default BUILD_MODE of ${postbuild_plugins[idx]} is declared with 99 (SKIP MODE) by default in plugins-base folder."

.TAOS-CI/config/config-plugins-prebuild.sh

-144
Original file line numberDiff line numberDiff line change
@@ -16,150 +16,6 @@ declare -i idx=-1
1616
echo "[MODULE] plugins-good: Plugin group that follow Apache license with good quality"
1717
# Please append your plugin modules here.
1818

19-
prebuild_plugins[++idx]="pr-prebuild-doxygen-tag"
20-
echo "${prebuild_plugins[idx]} is starting."
21-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a source code consists of required doxygen tags."
22-
echo "[DEBUG] The current path: $(pwd)."
23-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
24-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
25-
26-
prebuild_plugins[++idx]="pr-prebuild-indent"
27-
echo "${prebuild_plugins[idx]} is starting."
28-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with GNU indent"
29-
echo "[DEBUG] The current path: $(pwd)."
30-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
31-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
32-
33-
34-
prebuild_plugins[++idx]="pr-prebuild-clang"
35-
echo "${prebuild_plugins[idx]} is starting."
36-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with clang-format"
37-
echo "[DEBUG] The current path: $(pwd)."
38-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
39-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
40-
41-
#prebuild_plugins[++idx]="pr-prebuild-exclusive-vio"
42-
# echo "${prebuild_plugins[idx]} is starting."
43-
# echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check issue #279. VIO commits should not touch non VIO files."
44-
# echo "[DEBUG] The current path: $(pwd)."
45-
# echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
46-
# source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
47-
48-
prebuild_plugins[++idx]="pr-prebuild-pylint"
49-
echo "${prebuild_plugins[idx]} is starting."
50-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the code formatting style with pylint"
51-
echo "[DEBUG] The current path: $(pwd)."
52-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
53-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
54-
55-
prebuild_plugins[++idx]="pr-prebuild-newline"
56-
echo "${prebuild_plugins[idx]} is starting."
57-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if there is a newline issue in text files"
58-
echo "[DEBUG] The current path: $(pwd)."
59-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
60-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
61-
62-
prebuild_plugins[++idx]="pr-prebuild-rpm-spec"
63-
echo "${prebuild_plugins[idx]} is starting."
64-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if there is incorrect staements in *.spec file"
65-
echo "[DEBUG] The current path: $(pwd)."
66-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
67-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
68-
69-
prebuild_plugins[++idx]="pr-prebuild-file-size"
70-
echo "${prebuild_plugins[idx]} is starting."
71-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the file size to not include big binary files"
72-
echo "[DEBUG] The current path: $(pwd)."
73-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
74-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
75-
76-
prebuild_plugins[++idx]="pr-prebuild-cppcheck"
77-
echo "${prebuild_plugins[idx]} is starting."
78-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check dangerous coding constructs in source codes (*.c, *.cpp) with cppcheck"
79-
echo "[DEBUG] The current path: $(pwd)."
80-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
81-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
82-
83-
prebuild_plugins[++idx]="pr-prebuild-nobody"
84-
echo "${prebuild_plugins[idx]} is starting."
85-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the commit message body"
86-
echo "[DEBUG] The current path: $(pwd)."
87-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
88-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
89-
90-
prebuild_plugins[++idx]="pr-prebuild-timestamp"
91-
echo "${prebuild_plugins[idx]} is starting."
92-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check the timestamp of the commit"
93-
echo "[DEBUG] The current path: $(pwd)."
94-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
95-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
96-
97-
prebuild_plugins[++idx]="pr-prebuild-executable"
98-
echo "${prebuild_plugins[idx]} is starting."
99-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check executable bits for .cpp, .c, .hpp, .h, .prototxt, .caffemodel, .txt., .init"
100-
echo "[DEBUG] The current path: $(pwd)."
101-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
102-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
103-
104-
prebuild_plugins[++idx]="pr-prebuild-hardcoded-path"
105-
echo "${prebuild_plugins[idx]} is starting."
106-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check prohibited hardcoded paths (/home/* for now)"
107-
echo "[DEBUG] The current path: $(pwd)."
108-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
109-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
110-
111-
prebuild_plugins[++idx]="pr-prebuild-misspelling"
112-
echo "${prebuild_plugins[idx]} is starting."
113-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a misspelled statement in a document file with GNU Aspell"
114-
echo "[DEBUG] The current path: $(pwd)."
115-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
116-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
117-
118-
prebuild_plugins[++idx]="pr-prebuild-doxygen-build"
119-
echo "${prebuild_plugins[idx]} is starting."
120-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a doxygen grammar if a doxygen can normally generate source code"
121-
122-
prebuild_plugins[++idx]="pr-prebuild-sloccount"
123-
echo "${prebuild_plugins[idx]} is starting."
124-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check physical Source Lines of Code (SLOC) in a source code"
125-
echo "[DEBUG] The current path: $(pwd)."
126-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
127-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
128-
129-
prebuild_plugins[++idx]="pr-prebuild-prohibited-words"
130-
echo "${prebuild_plugins[idx]} is starting."
131-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check if source codes have prohibited words."
132-
echo "[DEBUG] The current path: $(pwd)."
133-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
134-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
135-
136-
prebuild_plugins[++idx]="pr-prebuild-signed-off-by"
137-
echo "${prebuild_plugins[idx]} is starting."
138-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check 'Signed-off-by' in commit body"
139-
echo "[DEBUG] The current path: $(pwd)."
140-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
141-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
142-
143-
prebuild_plugins[++idx]="pr-prebuild-shellcheck"
144-
echo "${prebuild_plugins[idx]} is starting."
145-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check a syntax error in a shell script file with 'shellcheck' package"
146-
echo "[DEBUG] The current path: $(pwd)."
147-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
148-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
149-
150-
prebuild_plugins[++idx]="pr-prebuild-flawfinder"
151-
echo "${prebuild_plugins[idx]} is starting."
152-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check security problems in the C/C++ source code with 'flawfinder' package"
153-
echo "[DEBUG] The current path: $(pwd)."
154-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
155-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
156-
157-
prebuild_plugins[++idx]="pr-prebuild-coverity"
158-
echo "${prebuild_plugins[idx]} is starting."
159-
echo "[MODULE] ${BOT_NAME}/${prebuild_plugins[idx]}: Check defects in the C/C++ source code with 'coverity' package"
160-
echo "[DEBUG] The current path: $(pwd)."
161-
echo "[DEBUG] source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh"
162-
source ${REFERENCE_REPOSITORY}/ci/taos/plugins-good/${prebuild_plugins[idx]}.sh
16319

16420
##################################################################################################################
16521
echo "[MODULE] plugins-staging: Plugin group that does not have an evaluation and aging test enough"

.github/workflows/android.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Build test: Android NDK r12b
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- uses: nttld/setup-ndk@v1
15+
with:
16+
ndk-version: r12b
17+
link-to-sdk: true
18+
- name: Check if rebuild required
19+
## @todo This should become a reusable workflow.
20+
run: |
21+
tmpfile=$(mktemp)
22+
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}
23+
echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV"
24+
rebuild=`bash .github/workflows/check_if_rebuild_requires.sh ${tmpfile} android | grep "REBUILD=YES" | wc -l`
25+
echo "Rebuild required: ${rebuild}"
26+
echo "rebuild=${rebuild}" >> "$GITHUB_ENV"
27+
- name: make cache key
28+
if: env.rebuild == '1'
29+
id: make-key
30+
run: echo "cache_key=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
31+
shell: bash
32+
- name: cache GST root
33+
id: cache-gbs-root
34+
if: env.rebuild == '1'
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/android
38+
key: ${{ steps.make-key.outputs.cache_key }}
39+
- name: Prepare Build
40+
if: env.rebuild == '1'
41+
run: |
42+
echo "::group::Install required packages"
43+
sudo apt-get update
44+
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
45+
echo "::endgroup::"
46+
if [[ -d ~/android/gst_root_android/arm64 ]] && [[ -f ~/android/gst_root_android/arm64/lib/libgstreamer-1.0.so ]]; then
47+
echo "Gst-Root-Android cached."
48+
else
49+
echo "::group::Download prebuilt Android-Gstreamer libraries"
50+
mkdir -p ~/android/gst_root_android/arm64
51+
pushd ~/android/gst_root_android/arm64
52+
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
53+
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
54+
tar -xf gstreamer-1.0-android-arm64-1.12.4-runtime.tar.bz2
55+
tar -xf gstreamer-1.0-android-arm64-1.12.4.tar.bz2
56+
popd
57+
echo "::endgroup::"
58+
fi
59+
- name: NDK Build
60+
if: env.rebuild == '1'
61+
run: |
62+
export GSTREAMER_ROOT_ANDROID=~/android/gst_root_android
63+
export TARGET_ARCH_ABI=arm64-v8a
64+
export ANDROID_ABI=arm64-v8a
65+
export APP_ALLOW_MISSING_DEPS=true
66+
export NNSTREAMER_ROOT=$(pwd)
67+
target_host=aarch64-linux-android
68+
export AR=$target_host-ar
69+
export AS=$target_host-clang
70+
export CC=$target_host-clang
71+
export CXX=$target_host-clang++
72+
export LD=$target_host-ld
73+
export STRIP=$target_host-strip
74+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/android/gst_root_android/arm64/lib/
75+
cd jni
76+
echo "::group::Build NNStreamer with ndk-build"
77+
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android-nnstreamer.mk NDK_APPLICATION_MK=./Application.mk -j$(nproc)
78+
echo "::endgroup::"
79+
ls -la ./libs/arm64-v8a/
80+
cp ./libs/arm64-v8a/libnnstreamer.so $GSTREAMER_ROOT_ANDROID/arm64/lib/gstreamer-1.0/
81+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./libs/arm64-v8a
82+
83+
# Workaround for the gstreamer-android prebuild binary build glitches
84+
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")
85+
if [[ ! -z $result ]]; then
86+
echo "Warning: the given prebuilt binaries for Android have incorrect rpaths."
87+
sudo mkdir -p /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/
88+
sudo ln -s ~/android/gst_root_android/arm64/lib /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/lib
89+
fi
90+
91+
echo "::group::Build a test application"
92+
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android-app.mk NDK_APPLICATION_MK=./Application.mk -j$(nproc)
93+
ls -la /data/nnstreamer/cerbero.custom-1.12.4-ndkr12b-20190213-0900/build/dist/android_arm64/lib/
94+
echo "::endgroup::"
95+
cd ..

.github/workflows/gbs_x64.yml .github/workflows/gbs_build.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: GBS Tizen build for x64 from Ubuntu
1+
name: Build and unit test: Tizen/GBS
22

33
# ${{ github.event.pull_request.commits }} : # commits in this PR
44
# - changed_file_list in GITHUB_ENV: the list of files updated in this pull-request.
@@ -10,6 +10,18 @@ on:
1010
jobs:
1111
build:
1212

13+
strategy:
14+
matrix:
15+
include:
16+
- aarch: "-A x86_64"
17+
option: "--define \"unit_test 1\""
18+
- aarch: "-A i586"
19+
option: "--define \"unit_test 1\""
20+
- aarch: "-A armv7l"
21+
option: "--define \"unit_test 0\""
22+
- aarch: "-A aarch64"
23+
option: "--define \"unit_test 0\""
24+
1325
runs-on: ubuntu-20.04
1426

1527
steps:
@@ -47,7 +59,11 @@ jobs:
4759
- name: run GBS
4860
if: env.rebuild == '1'
4961
run: |
50-
gbs build --skip-srcrpm --define "_skip_debug_rpm 1"
62+
gbs build --skip-srcrpm --define "_skip_debug_rpm 1" ${{ matrix.aarch }} ${{ matrix.option }}
63+
## Skip nntrainer build test in aarch64. @todo We need #2430 and #2431 in nntrainer.git
64+
if [[ "${{ matrix.aarch }}" == "-A aarch64" ]]; then
65+
echo "rebuild=0" >> "$GITHUB_ENV"
66+
fi
5167
- name: get nntrainer
5268
if: env.rebuild == '1'
5369
uses: actions/checkout@v3
@@ -57,4 +73,6 @@ jobs:
5773
- name: run nntrainer GBS build
5874
if: env.rebuild == '1'
5975
run: |
60-
pushd nntrainer && gbs build --skip-srcrpm --define "unit_test 1" --define "_skip_debug_rpm 1" && popd
76+
pushd nntrainer
77+
gbs build --skip-srcrpm ${{ matrix.aarch }} ${{ matrix.option }} --define "_skip_debug_rpm 1"
78+
popd

0 commit comments

Comments
 (0)