action: Yocto devtool test
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 13 Jun 2024 10:31:06 +0000 (19:31 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 20 Jun 2024 05:47:56 +0000 (14:47 +0900)
Test if a pull request breaks Yocto build or not.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
.github/workflows/yocto.yml [new file with mode: 0644]

diff --git a/.github/workflows/yocto.yml b/.github/workflows/yocto.yml
new file mode 100644 (file)
index 0000000..b57d4cb
--- /dev/null
@@ -0,0 +1,55 @@
+name: Yocto devtool test
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  build:
+    name: Build with Yocto devtool on Ubuntu
+    runs-on: ubuntu-20.04
+    steps:
+    - uses: actions/checkout@v4
+      with:
+        ref: ${{ github.event.pull_request.head.sha }}
+        fetch-depth: -${{ github.event.pull_request.commits }}
+    - name: Check if rebuild required
+      uses: ./.github/actions/check-rebuild
+      with:
+        mode: build
+    ## @todo Make cache works (daily update cache on main branch / restore the cache on each PR (not saving))
+    - 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 and reset previous builds"
+          . ~/poky_sdk/environment-setup-cortexa57-poky-linux
+          devtool reset -a -r
+        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