[openwrt/openwrt] CI: run inside the buildbot docker container

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 24 11:16:33 PDT 2022


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8a77adb0485aeb40f6550eb7fcdb461b3eaffe58

commit 8a77adb0485aeb40f6550eb7fcdb461b3eaffe58
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sun Mar 20 15:31:24 2022 +0000

    CI: run inside the buildbot docker container
    
    Run github actions insider buildbot docker container.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    [ run container under buildbot user ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .github/workflows/kernel.yml | 70 +++++++++++++++-----------------------------
 1 file changed, 24 insertions(+), 46 deletions(-)

diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml
index 268c703baf..f7e5d542b4 100644
--- a/.github/workflows/kernel.yml
+++ b/.github/workflows/kernel.yml
@@ -47,45 +47,17 @@ jobs:
        matrix:
          target: ${{fromJson(needs.determine_targets.outputs.target)}}
 
+    container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
+
     steps:
       - name: Checkout master directory
         uses: actions/checkout at v2
         with:
           path: openwrt
 
-      - name: Setup Ubuntu
-        env:
-          DEBIAN_FRONTEND: noninteractive
+      - name: Fix permission
         run: |
-          sudo apt-get update
-          sudo apt-get -y install \
-            build-essential \
-            ccache \
-            clang-12 \
-            ecj \
-            fastjar \
-            file \
-            g++ \
-            gawk \
-            gettext \
-            git \
-            java-propose-classpath \
-            libelf-dev \
-            libncurses-dev \
-            libssl-dev \
-            mkisofs \
-            python3 \
-            python3-dev \
-            python3-distutils \
-            python3-setuptools \
-            qemu-utils \
-            rsync \
-            subversion \
-            swig \
-            unzip \
-            wget \
-            xsltproc \
-            zlib1g-dev
+          chown -R buildbot:buildbot openwrt
 
       - name: Initialization environment
         run: |
@@ -95,25 +67,31 @@ jobs:
           echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
 
       - name: Update & Install feeds
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
         run: |
-          cd openwrt
           ./scripts/feeds update -a
           ./scripts/feeds install -a
 
-      - name: Setup external toolchain
+      - name: Parse toolchain file
+        working-directory: openwrt
         run: |
-          cd openwrt
           TOOLCHAIN_FILE=$(curl "https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \
             | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
 
           echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
-          
+
+      - name: Download external toolchain
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
+        run: |
           wget -O - https://downloads.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \
             | tar --xz -xf -
 
       - name: Configure external toolchain
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
         run: |
-          cd openwrt
           ./scripts/ext-toolchain.sh \
             --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \
             --config ${{ env.TARGET }}/${{ env.SUBTARGET }}
@@ -121,19 +99,19 @@ jobs:
           make defconfig
 
       - name: Build tools
-        run: |
-          cd openwrt
-          make tools/install -j$(nproc) BUILD_LOG=1
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
+        run: make tools/install -j$(nproc) BUILD_LOG=1
 
       - name: Build toolchain
-        run: |
-          cd openwrt
-          make toolchain/install -j$(nproc) BUILD_LOG=1
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
+        run: make toolchain/install -j$(nproc) BUILD_LOG=1
 
       - name: Build Kernel
-        run: |
-          cd openwrt
-          make target/compile -j$(nproc) BUILD_LOG=1
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
+        run: make target/compile -j$(nproc) BUILD_LOG=1
 
       - name: Upload logs
         if: failure()




More information about the lede-commits mailing list