CI: tools: directly copy prebuilt tools in container
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 10 Nov 2022 18:53:15 +0000 (19:53 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 23 Jan 2023 18:18:06 +0000 (19:18 +0100)
Directly copy prebuilt tools in container instead of creating an
archieve and extracting it later in other workflows.

Update build workflow to support this new implementation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
.github/workflows/Dockerfile.tools
.github/workflows/build-tools.yml
.github/workflows/build.yml
.github/workflows/check-kernel-patches.yml
.github/workflows/push-containers.yml

index c2ae7dc89659abb3631a724a9dce4b10c45612c0..a380475044504ef8d02b7e26f51053d2ec9b3e42 100644 (file)
@@ -1,3 +1,4 @@
 FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
 
-COPY --chown=buildbot:buildbot tools.tar /tools.tar
+COPY --chown=buildbot staging_dir/host /prebuilt_tools/staging_dir/host
+COPY --chown=buildbot build_dir/host /prebuilt_tools/build_dir/host
index ba19e12330b9c9c34f948bcea18a1a652c064fc5..1507b0b056bec1b9702f9390a97e985d431311bd 100644 (file)
@@ -61,7 +61,7 @@ jobs:
         if: inputs.generate_prebuilt_artifacts == true
         shell: su buildbot -c "sh -e {0}"
         working-directory: openwrt
-        run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host
+        run: tar -cf tools.tar staging_dir/host build_dir/host
 
       - name: Upload prebuilt tools
         if: inputs.generate_prebuilt_artifacts == true
index de168c0cb90c6ce689cd7388904c06f5d3261ae4..62a4441a3b7b6058989747ee22b38eb0d23f9716 100644 (file)
@@ -137,6 +137,16 @@ jobs:
           echo "TARGET=$TARGET" >> "$GITHUB_ENV"
           echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
 
+      - name: Prepare prebuilt tools
+        shell: su buildbot -c "sh -e {0}"
+        working-directory: openwrt
+        run: |
+          mkdir -p staging_dir build_dir
+          ln -s /prebuilt_tools/staging_dir/host staging_dir/host
+          ln -s /prebuilt_tools/build_dir/host build_dir/host
+
+          ./scripts/ext-tools.sh --refresh
+
       - name: Update & Install feeds
         if: inputs.include_feeds == true
         shell: su buildbot -c "sh -e {0}"
@@ -221,11 +231,6 @@ jobs:
           wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \
             | tar --xz -xf -
 
-      - name: Extract prebuilt tools
-        shell: su buildbot -c "sh -e {0}"
-        working-directory: openwrt
-        run: ./scripts/ext-tools.sh --tools /tools.tar
-
       - name: Configure testing kernel
         if: inputs.testing == true
         shell: su buildbot -c "sh -e {0}"
index e5b619064f60604f41c9587deb6f1d6449d42967..7e0fe5071a5ace9d52c88db1fc247d90f36db03b 100644 (file)
@@ -84,10 +84,15 @@ jobs:
           echo "TARGET=$TARGET" >> "$GITHUB_ENV"
           echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
 
-      - name: Extract prebuilt tools
+      - name: Prepare prebuilt tools
         shell: su buildbot -c "sh -e {0}"
         working-directory: openwrt
-        run: ./scripts/ext-tools.sh --tools /tools.tar
+        run: |
+          mkdir -p staging_dir build_dir
+          ln -sf /prebuilt_tools/staging_dir/host staging_dir/host
+          ln -sf /prebuilt_tools/build_dir/host build_dir/host
+
+          ./scripts/ext-tools.sh --refresh
 
       - name: Configure testing kernel
         if: inputs.testing == true
index 56e0daa611b87220feee3ffdff1eb2551eeb4c70..4045dfaa294241300bc09507d2707782e1b8dc1b 100644 (file)
@@ -70,6 +70,10 @@ jobs:
           name: linux-buildbot-prebuilt-tools
           path: openwrt
 
+      - name: Extract prebuild tools
+        working-directory: openwrt
+        run: tar -xf tools.tar
+
       - name: Login to GitHub Container Registry
         uses: docker/login-action@v2
         with: