CI: run inside the buildbot docker container
authorPaul Spooren <mail@aparcar.org>
Sun, 20 Mar 2022 15:31:24 +0000 (15:31 +0000)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Sun, 4 Dec 2022 15:26:59 +0000 (16:26 +0100)
Run github actions insider buildbot docker container.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[ run container under buildbot user ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8a77adb0485aeb40f6550eb7fcdb461b3eaffe58)

.github/workflows/kernel.yml

index 268c703bafb5932ee55d9842daeadeed509e328f..f7e5d542b4250117f39e4bb64842393911274a35 100644 (file)
@@ -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@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()